From ec37187da113edc7dba75ee31008db3f78f0e174 Mon Sep 17 00:00:00 2001 From: AWS CDK Team Date: Mon, 22 Mar 2021 15:53:25 +0000 Subject: [PATCH] chore(release): v1.26.0 --- internal/api/api.go | 28 ++++- internal/embedded/embedded.go | 2 +- internal/embedded/resources/lib/program.js | 4 +- .../embedded/resources/lib/program.js.map | 2 +- internal/kernel/callbacks.go | 19 ++- internal/kernel/client_test.go | 3 +- internal/kernel/conversions.go | 108 +++++++++++++----- internal/kernel/create.go | 6 +- internal/kernel/manage-object.go | 7 +- internal/kernel/version.generated.go | 2 +- internal/objectstore/objectstore.go | 15 ++- internal/typeregistry/discover-implemented.go | 48 ++++++-- internal/typeregistry/overrides.go | 17 +++ internal/typeregistry/registration.go | 12 +- internal/typeregistry/typeregistry.go | 13 ++- runtime.go | 42 ++++--- version | 2 +- 17 files changed, 257 insertions(+), 73 deletions(-) create mode 100644 internal/typeregistry/overrides.go diff --git a/internal/api/api.go b/internal/api/api.go index 96cc33e..83d354b 100644 --- a/internal/api/api.go +++ b/internal/api/api.go @@ -1,5 +1,10 @@ package api +import ( + "fmt" + "regexp" +) + // FQN represents a fully-qualified type name in the jsii type system. type FQN string @@ -8,14 +13,13 @@ type FQN string // MethodOverride and PropertyOverride to simulate the union type of Override = // MethodOverride | PropertyOverride. type Override interface { + GoName() string isOverride() } type override struct{} -func (o override) isOverride() { - return -} +func (o override) isOverride() {} // MethodOverride is used to register a "go-native" implementation to be // substituted to the default javascript implementation on the created object. @@ -26,6 +30,10 @@ type MethodOverride struct { GoMethod string `json:"cookie"` } +func (m MethodOverride) GoName() string { + return m.GoMethod +} + // PropertyOverride is used to register a "go-native" implementation to be // substituted to the default javascript implementation on the created object. type PropertyOverride struct { @@ -35,6 +43,10 @@ type PropertyOverride struct { GoGetter string `json:"cookie"` } +func (m PropertyOverride) GoName() string { + return m.GoGetter +} + func IsMethodOverride(value Override) bool { switch value.(type) { case MethodOverride, *MethodOverride: @@ -55,6 +67,16 @@ func IsPropertyOverride(value Override) bool { type ObjectRef struct { InstanceID string `json:"$jsii.byref"` + Interfaces []FQN `json:"$jsii.interfaces,omitempty"` +} + +func (o *ObjectRef) TypeFQN() FQN { + re := regexp.MustCompile("^(.+)@(\\d+)$") + if parts := re.FindStringSubmatch(o.InstanceID); parts == nil { + panic(fmt.Errorf("invalid instance id: %s", o.InstanceID)) + } else { + return FQN(parts[1]) + } } type EnumRef struct { diff --git a/internal/embedded/embedded.go b/internal/embedded/embedded.go index 6b39b3c..cfe003a 100644 --- a/internal/embedded/embedded.go +++ b/internal/embedded/embedded.go @@ -13,7 +13,7 @@ const embeddedRootDir string = "resources" var embeddedFS embed.FS // entrypointName is the path to the entry point relative to the embeddedRootDir. -var entrypointName string = path.Join("bin", "jsii-runtime.js") +var entrypointName = path.Join("bin", "jsii-runtime.js") // ExtractRuntime extracts a copy of the embedded runtime library into // the designated directory, and returns the fully qualified path to the entry diff --git a/internal/embedded/resources/lib/program.js b/internal/embedded/resources/lib/program.js index f820f4e..6b3b18f 100644 --- a/internal/embedded/resources/lib/program.js +++ b/internal/embedded/resources/lib/program.js @@ -9836,11 +9836,11 @@ var __webpack_modules__ = { }, 306: module => { "use strict"; - module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.25.0","description":"jsii runtime kernel process","license":"Apache-2.0","author":{"name":"Amazon Web Services","url":"https://aws.amazon.com"},"homepage":"https://github.com/aws/jsii","bugs":{"url":"https://github.com/aws/jsii/issues"},"repository":{"type":"git","url":"https://github.com/aws/jsii.git","directory":"packages/@jsii/runtime"},"engines":{"node":">= 10.3.0"},"main":"lib/index.js","types":"lib/index.d.ts","bin":{"jsii-runtime":"bin/jsii-runtime"},"scripts":{"build":"tsc --build && chmod +x bin/jsii-runtime && npx webpack-cli && npm run lint","watch":"tsc --build -w","lint":"eslint . --ext .js,.ts --ignore-path=.gitignore --ignore-pattern=webpack.config.js","lint:fix":"yarn lint --fix","test":"jest","test:update":"jest -u","package":"package-js"},"dependencies":{"@jsii/kernel":"^1.25.0","@jsii/spec":"^1.25.0"},"devDependencies":{"@scope/jsii-calc-base":"^1.25.0","@scope/jsii-calc-lib":"^1.25.0","@types/jest":"^26.0.20","@types/node":"^10.17.55","eslint":"^7.22.0","jest":"^26.6.3","jsii-build-tools":"^1.25.0","jsii-calc":"^3.20.120","prettier":"^2.2.1","source-map-loader":"^2.0.1","ts-jest":"^26.5.3","typescript":"~3.9.9","webpack":"^5.25.1","webpack-cli":"^4.5.0"}}'); + module.exports = JSON.parse('{"name":"@jsii/runtime","version":"1.26.0","description":"jsii runtime kernel process","license":"Apache-2.0","author":{"name":"Amazon Web Services","url":"https://aws.amazon.com"},"homepage":"https://github.com/aws/jsii","bugs":{"url":"https://github.com/aws/jsii/issues"},"repository":{"type":"git","url":"https://github.com/aws/jsii.git","directory":"packages/@jsii/runtime"},"engines":{"node":">= 10.3.0"},"main":"lib/index.js","types":"lib/index.d.ts","bin":{"jsii-runtime":"bin/jsii-runtime"},"scripts":{"build":"tsc --build && chmod +x bin/jsii-runtime && npx webpack-cli && npm run lint","watch":"tsc --build -w","lint":"eslint . --ext .js,.ts --ignore-path=.gitignore --ignore-pattern=webpack.config.js","lint:fix":"yarn lint --fix","test":"jest","test:update":"jest -u","package":"package-js"},"dependencies":{"@jsii/kernel":"^1.26.0","@jsii/spec":"^1.26.0"},"devDependencies":{"@scope/jsii-calc-base":"^1.26.0","@scope/jsii-calc-lib":"^1.26.0","@types/jest":"^26.0.20","@types/node":"^10.17.55","eslint":"^7.22.0","jest":"^26.6.3","jsii-build-tools":"^1.26.0","jsii-calc":"^3.20.120","prettier":"^2.2.1","source-map-loader":"^2.0.1","ts-jest":"^26.5.4","typescript":"~3.9.9","webpack":"^5.26.3","webpack-cli":"^4.5.0"}}'); }, 373: module => { "use strict"; - module.exports = JSON.parse('{"$ref":"#/definitions/Assembly","$schema":"http://json-schema.org/draft-07/schema#","definitions":{"Assembly":{"description":"A JSII assembly specification.","properties":{"author":{"$ref":"#/definitions/Person","description":"The main author of this package."},"bin":{"additionalProperties":{"type":"string"},"default":"none","description":"List of bin-scripts","type":"object"},"bundled":{"additionalProperties":{"type":"string"},"default":"none","description":"List if bundled dependencies (these are not expected to be jsii\\nassemblies).","type":"object"},"contributors":{"default":"none","description":"Additional contributors to this package.","items":{"$ref":"#/definitions/Person"},"type":"array"},"dependencies":{"additionalProperties":{"type":"string"},"default":"none","description":"Direct dependencies on other assemblies (with semver), the key is the JSII\\nassembly name, and the value is a SemVer expression.","type":"object"},"dependencyClosure":{"additionalProperties":{"$ref":"#/definitions/AssemblyConfiguration"},"default":"none","description":"Target configuration for all the assemblies that are direct or transitive\\ndependencies of this assembly. This is needed to generate correct native\\ntype names for any transitively inherited member, in certain languages.","type":"object"},"description":{"description":"Description of the assembly, maps to \\"description\\" from package.json\\nThis is required since some package managers (like Maven) require it.","type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fingerprint":{"description":"A fingerprint that can be used to determine if the specification has\\nchanged.","minLength":1,"type":"string"},"homepage":{"description":"The url to the project homepage. Maps to \\"homepage\\" from package.json.","type":"string"},"jsiiVersion":{"description":"The version of the jsii compiler that was used to produce this Assembly.","minLength":1,"type":"string"},"keywords":{"description":"Keywords that help discover or identify this packages with respects to it\'s\\nintended usage, audience, etc... Where possible, this will be rendered in\\nthe corresponding metadata section of idiomatic package manifests, for\\nexample NuGet package tags.","items":{"type":"string"},"type":"array"},"license":{"description":"The SPDX name of the license this assembly is distributed on.","type":"string"},"metadata":{"additionalProperties":{},"default":"none","description":"Arbitrary key-value pairs of metadata, which the maintainer chose to\\ndocument with the assembly. These entries do not carry normative\\nsemantics and their interpretation is up to the assembly maintainer.","type":"object"},"name":{"description":"The name of the assembly","minLength":1,"type":"string"},"readme":{"$ref":"#/definitions/ReadMe","default":"none","description":"The readme document for this module (if any)."},"repository":{"description":"The module repository, maps to \\"repository\\" from package.json\\nThis is required since some package managers (like Maven) require it.","properties":{"directory":{"default":"the root of the repository","description":"If the package is not in the root directory (for example, when part\\nof a monorepo), you should specify the directory in which it lives.","type":"string"},"type":{"description":"The type of the repository (``git``, ``svn``, ...)","type":"string"},"url":{"description":"The URL of the repository.","type":"string"}},"required":["type","url"],"type":"object"},"schema":{"description":"The version of the spec schema","enum":["jsii/0.10.0"],"type":"string"},"submodules":{"additionalProperties":{"allOf":[{"$ref":"#/definitions/SourceLocatable"},{"$ref":"#/definitions/Targetable"}],"description":"A submodule\\n\\nThe difference between a top-level module (the assembly) and a submodule is\\nthat the submodule is annotated with its location in the repository."},"default":"none","description":"Submodules declared in this assembly.","type":"object"},"targets":{"$ref":"#/definitions/AssemblyTargets","default":"none","description":"A map of target name to configuration, which is used when generating\\npackages for various languages."},"types":{"additionalProperties":{"anyOf":[{"allOf":[{"$ref":"#/definitions/TypeBase"},{"$ref":"#/definitions/ClassType"}]},{"allOf":[{"$ref":"#/definitions/TypeBase"},{"$ref":"#/definitions/EnumType"}]},{"allOf":[{"$ref":"#/definitions/TypeBase"},{"$ref":"#/definitions/InterfaceType"}]}],"description":"Represents a type definition (not a type reference)."},"default":"none","description":"All types in the assembly, keyed by their fully-qualified-name","type":"object"},"version":{"description":"The version of the assembly","minLength":1,"type":"string"}},"required":["author","description","fingerprint","homepage","jsiiVersion","license","name","repository","schema","version"],"type":"object"},"AssemblyConfiguration":{"description":"Shareable configuration of a jsii Assembly.","properties":{"readme":{"$ref":"#/definitions/ReadMe","default":"none","description":"The readme document for this module (if any)."},"submodules":{"additionalProperties":{"allOf":[{"$ref":"#/definitions/SourceLocatable"},{"$ref":"#/definitions/Targetable"}],"description":"A submodule\\n\\nThe difference between a top-level module (the assembly) and a submodule is\\nthat the submodule is annotated with its location in the repository."},"default":"none","description":"Submodules declared in this assembly.","type":"object"},"targets":{"$ref":"#/definitions/AssemblyTargets","default":"none","description":"A map of target name to configuration, which is used when generating\\npackages for various languages."}},"type":"object"},"AssemblyTargets":{"additionalProperties":{"additionalProperties":{},"type":"object"},"description":"Configurable targets for an asembly.","type":"object"},"Callable":{"description":"An Initializer or a Method.","properties":{"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"overrides":{"default":"this member is not overriding anything","description":"The FQN of the parent type (class or interface) that this entity\\noverrides or implements. If undefined, then this entity is the first in\\nit\'s hierarchy to declare this entity.","type":"string"},"parameters":{"default":"none","description":"The parameters of the Initializer or Method.","items":{"$ref":"#/definitions/Parameter"},"type":"array"},"protected":{"default":false,"description":"Indicates if this Initializer or Method is protected (otherwise it is\\npublic, since private members are not modeled).","type":"boolean"},"variadic":{"default":false,"description":"Indicates whether this Initializer or Method is variadic or not. When\\n``true``, the last element of ``#parameters`` will also be flagged\\n``#variadic``.","type":"boolean"}},"type":"object"},"ClassType":{"description":"Represents classes.","properties":{"abstract":{"default":false,"description":"Indicates if this class is an abstract class.","type":"boolean"},"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"base":{"default":"no base class","description":"The FQN of the base class of this class, if it has one.","type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``..``)","minLength":3,"type":"string"},"initializer":{"$ref":"#/definitions/Callable","default":"no initializer","description":"Initializer (constructor) method."},"interfaces":{"default":"none","description":"The FQNs of the interfaces this class implements, if any.","items":{"type":"string"},"type":"array","uniqueItems":true},"kind":{"description":"The kind of the type.","enum":["class"],"type":"string"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"methods":{"default":"none","description":"List of methods.","items":{"$ref":"#/definitions/Method"},"type":"array"},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly\\n(it\'s ``fqn`` would be like ``.``). If the `namespace` corresponds to an existing type\'s\\nnamespace-qualified (e.g: ``.``), then the current type is a nested type.","type":"string"},"properties":{"default":"none","description":"List of properties.","items":{"$ref":"#/definitions/Property"},"type":"array"}},"required":["assembly","fqn","kind","name"],"type":"object"},"CollectionKind":{"description":"Kinds of collections.","enum":["array","map"],"type":"string"},"CollectionTypeReference":{"description":"Reference to a collection type.","properties":{"collection":{"properties":{"elementtype":{"$ref":"#/definitions/TypeReference","description":"The type of an element (map keys are always strings)."},"kind":{"$ref":"#/definitions/CollectionKind","description":"The kind of collection."}},"required":["elementtype","kind"],"type":"object"}},"required":["collection"],"type":"object"},"Docs":{"description":"Key value pairs of documentation nodes.\\nBased on TSDoc.","properties":{"custom":{"additionalProperties":{"type":"string"},"default":"none","description":"Custom tags that are not any of the default ones","type":"object"},"default":{"default":"none","description":"Description of the default","type":"string"},"deprecated":{"default":"none","description":"If present, this block indicates that an API item is no longer supported\\nand may be removed in a future release. The `@deprecated` tag must be\\nfollowed by a sentence describing the recommended alternative.\\nDeprecation recursively applies to members of a container. For example,\\nif a class is deprecated, then so are all of its members.","type":"string"},"example":{"default":"none","description":"Example showing the usage of this API item\\n\\nStarts off in running text mode, may switch to code using fenced code\\nblocks.","type":"string"},"remarks":{"default":"none","description":"Detailed information about an API item.\\n\\nEither the explicitly tagged `@remarks` section, otherwise everything\\npast the first paragraph if there is no `@remarks` tag.","type":"string"},"returns":{"default":"none","description":"The `@returns` block for this doc comment, or undefined if there is not\\none.","type":"string"},"see":{"default":"none","description":"A `@see` link with more information","type":"string"},"stability":{"description":"Whether the API item is beta/experimental quality","enum":["deprecated","experimental","external","stable"],"type":"string"},"subclassable":{"default":false,"description":"Whether this class or interface was intended to be subclassed/implemented\\nby library users.\\n\\nClasses intended for subclassing, and interfaces intended to be\\nimplemented by consumers, are held to stricter standards of API\\ncompatibility.","type":"boolean"},"summary":{"default":"none","description":"Summary documentation for an API item.\\n\\nThe first part of the documentation before hitting a `@remarks` tags, or\\nthe first line of the doc comment block if there is no `@remarks` tag.","type":"string"}},"type":"object"},"EnumMember":{"description":"Represents a member of an enum.","properties":{"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"name":{"description":"The name/symbol of the member.","type":"string"}},"required":["name"],"type":"object"},"EnumType":{"description":"Represents an enum type.","properties":{"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``..``)","minLength":3,"type":"string"},"kind":{"description":"The kind of the type.","enum":["enum"],"type":"string"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"members":{"description":"Members of the enum.","items":{"$ref":"#/definitions/EnumMember"},"type":"array"},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly\\n(it\'s ``fqn`` would be like ``.``). If the `namespace` corresponds to an existing type\'s\\nnamespace-qualified (e.g: ``.``), then the current type is a nested type.","type":"string"}},"required":["assembly","fqn","kind","members","name"],"type":"object"},"InterfaceType":{"properties":{"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"datatype":{"default":false,"description":"True if this interface only contains properties. Different backends might\\nhave idiomatic ways to allow defining concrete instances such interfaces.\\nFor example, in Java, the generator will produce a PoJo and a builder\\nwhich will allow users to create a concrete object with data which\\nadheres to this interface.","type":"boolean"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``..``)","minLength":3,"type":"string"},"interfaces":{"default":"none","description":"The FQNs of the interfaces this interface extends, if any.","items":{"type":"string"},"type":"array","uniqueItems":true},"kind":{"description":"The kind of the type.","enum":["interface"],"type":"string"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"methods":{"default":"none","description":"List of methods.","items":{"$ref":"#/definitions/Method"},"type":"array"},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly\\n(it\'s ``fqn`` would be like ``.``). If the `namespace` corresponds to an existing type\'s\\nnamespace-qualified (e.g: ``.``), then the current type is a nested type.","type":"string"},"properties":{"default":"none","description":"List of properties.","items":{"$ref":"#/definitions/Property"},"type":"array"}},"required":["assembly","fqn","kind","name"],"type":"object"},"Method":{"description":"A method with a name (i.e: not an initializer).","properties":{"abstract":{"default":false,"description":"Is this method an abstract method (this means the class will also be an abstract class)","type":"boolean"},"async":{"default":false,"description":"Indicates if this is an asynchronous method (it will return a promise).","type":"boolean"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"name":{"description":"The name of the method. Undefined if this method is a initializer.","type":"string"},"overrides":{"default":"this member is not overriding anything","description":"The FQN of the parent type (class or interface) that this entity\\noverrides or implements. If undefined, then this entity is the first in\\nit\'s hierarchy to declare this entity.","type":"string"},"parameters":{"default":"none","description":"The parameters of the Initializer or Method.","items":{"$ref":"#/definitions/Parameter"},"type":"array"},"protected":{"default":false,"description":"Indicates if this Initializer or Method is protected (otherwise it is\\npublic, since private members are not modeled).","type":"boolean"},"returns":{"$ref":"#/definitions/OptionalValue","default":"void","description":"The return type of the method (`undefined` if `void`)"},"static":{"default":false,"description":"Indicates if this is a static method.","type":"boolean"},"variadic":{"default":false,"description":"Indicates whether this Initializer or Method is variadic or not. When\\n``true``, the last element of ``#parameters`` will also be flagged\\n``#variadic``.","type":"boolean"}},"required":["name"],"type":"object"},"NamedTypeReference":{"description":"Reference to a named type, defined by this assembly or one of its\\ndependencies.","properties":{"fqn":{"description":"The fully-qualified-name of the type (can be located in the\\n``spec.types[fqn]``` of the assembly that defines the type).","type":"string"}},"required":["fqn"],"type":"object"},"OptionalValue":{"description":"A value that can possibly be optional.","properties":{"optional":{"default":false,"description":"Determines whether the value is, indeed, optional.","type":"boolean"},"type":{"$ref":"#/definitions/TypeReference","description":"The declared type of the value, when it\'s present."}},"required":["type"],"type":"object"},"Parameter":{"description":"Represents a method parameter.","properties":{"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"name":{"description":"The name of the parameter.","minLength":1,"type":"string"},"optional":{"default":false,"description":"Determines whether the value is, indeed, optional.","type":"boolean"},"type":{"$ref":"#/definitions/TypeReference","description":"The declared type of the value, when it\'s present."},"variadic":{"default":false,"description":"Whether this is the last parameter of a variadic method. In such cases,\\nthe `#type` attribute is the type of each individual item of the variadic\\narguments list (as opposed to some array type, as for example TypeScript\\nwould model it).","type":"boolean"}},"required":["name","type"],"type":"object"},"Person":{"description":"Metadata about people or organizations associated with the project that\\nresulted in the Assembly. Some of this metadata is required in order to\\npublish to certain package repositories (for example, Maven Central), but is\\nnot normalized, and the meaning of fields (role, for example), is up to each\\nproject maintainer.","properties":{"email":{"default":"none","description":"The email of the person","type":"string"},"name":{"description":"The name of the person","type":"string"},"organization":{"default":false,"description":"If true, this person is, in fact, an organization","type":"boolean"},"roles":{"description":"A list of roles this person has in the project, for example `maintainer`,\\n`contributor`, `owner`, ...","items":{"type":"string"},"type":"array"},"url":{"default":"none","description":"The URL for the person","type":"string"}},"required":["name","roles"],"type":"object"},"PrimitiveType":{"description":"Kinds of primitive types.","enum":["any","boolean","date","json","number","string"],"type":"string"},"PrimitiveTypeReference":{"description":"Reference to a primitive type.","properties":{"primitive":{"$ref":"#/definitions/PrimitiveType","description":"If this is a reference to a primitive type, this will include the\\nprimitive type kind."}},"required":["primitive"],"type":"object"},"Property":{"description":"A class property.","properties":{"abstract":{"default":false,"description":"Indicates if this property is abstract","type":"boolean"},"const":{"default":false,"description":"A hint that indicates that this static, immutable property is initialized\\nduring startup. This allows emitting \\"const\\" idioms in different target\\nlanguages. Implies `static` and `immutable`.","type":"boolean"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"immutable":{"default":false,"description":"Indicates if this property only has a getter (immutable).","type":"boolean"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"name":{"description":"The name of the property.","minLength":1,"type":"string"},"optional":{"default":false,"description":"Determines whether the value is, indeed, optional.","type":"boolean"},"overrides":{"default":"this member is not overriding anything","description":"The FQN of the parent type (class or interface) that this entity\\noverrides or implements. If undefined, then this entity is the first in\\nit\'s hierarchy to declare this entity.","type":"string"},"protected":{"default":false,"description":"Indicates if this property is protected (otherwise it is public)","type":"boolean"},"static":{"default":false,"description":"Indicates if this is a static property.","type":"boolean"},"type":{"$ref":"#/definitions/TypeReference","description":"The declared type of the value, when it\'s present."}},"required":["name","type"],"type":"object"},"ReadMe":{"description":"README information","properties":{"markdown":{"type":"string"}},"required":["markdown"],"type":"object"},"SourceLocatable":{"description":"Indicates that an entity has a source location","properties":{"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."}},"type":"object"},"SourceLocation":{"description":"Where in the module source the definition for this API item was found","properties":{"filename":{"description":"Relative filename","type":"string"},"line":{"description":"1-based line number in the indicated file","type":"number"}},"required":["filename","line"],"type":"object"},"Targetable":{"description":"A targetable module-like thing\\n\\nHas targets and a readme. Used for Assemblies and Submodules.","properties":{"readme":{"$ref":"#/definitions/ReadMe","default":"none","description":"The readme document for this module (if any)."},"targets":{"$ref":"#/definitions/AssemblyTargets","default":"none","description":"A map of target name to configuration, which is used when generating\\npackages for various languages."}},"type":"object"},"TypeBase":{"description":"Common attributes of a type definition.","properties":{"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``..``)","minLength":3,"type":"string"},"kind":{"$ref":"#/definitions/TypeKind","description":"The kind of the type."},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly\\n(it\'s ``fqn`` would be like ``.``). If the `namespace` corresponds to an existing type\'s\\nnamespace-qualified (e.g: ``.``), then the current type is a nested type.","type":"string"}},"required":["assembly","fqn","kind","name"],"type":"object"},"TypeKind":{"description":"Kinds of types.","enum":["class","enum","interface"],"type":"string"},"TypeReference":{"anyOf":[{"$ref":"#/definitions/NamedTypeReference"},{"$ref":"#/definitions/PrimitiveTypeReference"},{"$ref":"#/definitions/CollectionTypeReference"},{"$ref":"#/definitions/UnionTypeReference"}],"description":"A reference to a type (primitive, collection or fqn)."},"UnionTypeReference":{"description":"Reference to a union type.","properties":{"union":{"description":"Indicates that this is a union type, which means it can be one of a set\\nof types.","properties":{"types":{"description":"All the possible types (including the primary type).","items":{"$ref":"#/definitions/TypeReference"},"minItems":2,"type":"array"}},"required":["types"],"type":"object"}},"required":["union"],"type":"object"}}}'); + module.exports = JSON.parse('{"$ref":"#/definitions/Assembly","$schema":"http://json-schema.org/draft-07/schema#","definitions":{"Assembly":{"description":"A JSII assembly specification.","properties":{"author":{"$ref":"#/definitions/Person","description":"The main author of this package."},"bin":{"additionalProperties":{"type":"string"},"default":"none","description":"List of bin-scripts","type":"object"},"bundled":{"additionalProperties":{"type":"string"},"default":"none","description":"List if bundled dependencies (these are not expected to be jsii\\nassemblies).","type":"object"},"contributors":{"default":"none","description":"Additional contributors to this package.","items":{"$ref":"#/definitions/Person"},"type":"array"},"dependencies":{"additionalProperties":{"type":"string"},"default":"none","description":"Direct dependencies on other assemblies (with semver), the key is the JSII\\nassembly name, and the value is a SemVer expression.","type":"object"},"dependencyClosure":{"additionalProperties":{"$ref":"#/definitions/AssemblyConfiguration"},"default":"none","description":"Target configuration for all the assemblies that are direct or transitive\\ndependencies of this assembly. This is needed to generate correct native\\ntype names for any transitively inherited member, in certain languages.","type":"object"},"description":{"description":"Description of the assembly, maps to \\"description\\" from package.json\\nThis is required since some package managers (like Maven) require it.","type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fingerprint":{"description":"A fingerprint that can be used to determine if the specification has\\nchanged.","minLength":1,"type":"string"},"homepage":{"description":"The url to the project homepage. Maps to \\"homepage\\" from package.json.","type":"string"},"jsiiVersion":{"description":"The version of the jsii compiler that was used to produce this Assembly.","minLength":1,"type":"string"},"keywords":{"description":"Keywords that help discover or identify this packages with respects to it\'s\\nintended usage, audience, etc... Where possible, this will be rendered in\\nthe corresponding metadata section of idiomatic package manifests, for\\nexample NuGet package tags.","items":{"type":"string"},"type":"array"},"license":{"description":"The SPDX name of the license this assembly is distributed on.","type":"string"},"metadata":{"additionalProperties":{},"default":"none","description":"Arbitrary key-value pairs of metadata, which the maintainer chose to\\ndocument with the assembly. These entries do not carry normative\\nsemantics and their interpretation is up to the assembly maintainer.","type":"object"},"name":{"description":"The name of the assembly","minLength":1,"type":"string"},"readme":{"$ref":"#/definitions/ReadMe","default":"none","description":"The readme document for this module (if any)."},"repository":{"description":"The module repository, maps to \\"repository\\" from package.json\\nThis is required since some package managers (like Maven) require it.","properties":{"directory":{"default":"the root of the repository","description":"If the package is not in the root directory (for example, when part\\nof a monorepo), you should specify the directory in which it lives.","type":"string"},"type":{"description":"The type of the repository (``git``, ``svn``, ...)","type":"string"},"url":{"description":"The URL of the repository.","type":"string"}},"required":["type","url"],"type":"object"},"schema":{"description":"The version of the spec schema","enum":["jsii/0.10.0"],"type":"string"},"submodules":{"additionalProperties":{"allOf":[{"$ref":"#/definitions/SourceLocatable"},{"$ref":"#/definitions/Targetable"}],"description":"A submodule\\n\\nThe difference between a top-level module (the assembly) and a submodule is\\nthat the submodule is annotated with its location in the repository."},"default":"none","description":"Submodules declared in this assembly.","type":"object"},"targets":{"$ref":"#/definitions/AssemblyTargets","default":"none","description":"A map of target name to configuration, which is used when generating\\npackages for various languages."},"types":{"additionalProperties":{"anyOf":[{"allOf":[{"$ref":"#/definitions/TypeBase"},{"$ref":"#/definitions/ClassType"}]},{"allOf":[{"$ref":"#/definitions/TypeBase"},{"$ref":"#/definitions/EnumType"}]},{"allOf":[{"$ref":"#/definitions/TypeBase"},{"$ref":"#/definitions/InterfaceType"}]}],"description":"Represents a type definition (not a type reference)."},"default":"none","description":"All types in the assembly, keyed by their fully-qualified-name","type":"object"},"version":{"description":"The version of the assembly","minLength":1,"type":"string"}},"required":["author","description","fingerprint","homepage","jsiiVersion","license","name","repository","schema","version"],"type":"object"},"AssemblyConfiguration":{"description":"Shareable configuration of a jsii Assembly.","properties":{"readme":{"$ref":"#/definitions/ReadMe","default":"none","description":"The readme document for this module (if any)."},"submodules":{"additionalProperties":{"allOf":[{"$ref":"#/definitions/SourceLocatable"},{"$ref":"#/definitions/Targetable"}],"description":"A submodule\\n\\nThe difference between a top-level module (the assembly) and a submodule is\\nthat the submodule is annotated with its location in the repository."},"default":"none","description":"Submodules declared in this assembly.","type":"object"},"targets":{"$ref":"#/definitions/AssemblyTargets","default":"none","description":"A map of target name to configuration, which is used when generating\\npackages for various languages."}},"type":"object"},"AssemblyTargets":{"additionalProperties":{"additionalProperties":{},"type":"object"},"description":"Configurable targets for an asembly.","type":"object"},"Callable":{"description":"An Initializer or a Method.","properties":{"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"overrides":{"default":"this member is not overriding anything","description":"The FQN of the parent type (class or interface) that this entity\\noverrides or implements. If undefined, then this entity is the first in\\nit\'s hierarchy to declare this entity.","type":"string"},"parameters":{"default":"none","description":"The parameters of the Initializer or Method.","items":{"$ref":"#/definitions/Parameter"},"type":"array"},"protected":{"default":false,"description":"Indicates if this Initializer or Method is protected (otherwise it is\\npublic, since private members are not modeled).","type":"boolean"},"variadic":{"default":false,"description":"Indicates whether this Initializer or Method is variadic or not. When\\n``true``, the last element of ``#parameters`` will also be flagged\\n``#variadic``.","type":"boolean"}},"type":"object"},"ClassType":{"description":"Represents classes.","properties":{"abstract":{"default":false,"description":"Indicates if this class is an abstract class.","type":"boolean"},"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"base":{"default":"no base class","description":"The FQN of the base class of this class, if it has one.","type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``..``)","minLength":3,"type":"string"},"initializer":{"$ref":"#/definitions/Callable","default":"no initializer","description":"Initializer (constructor) method."},"interfaces":{"default":"none","description":"The FQNs of the interfaces this class implements, if any.","items":{"type":"string"},"type":"array","uniqueItems":true},"kind":{"description":"The kind of the type.","enum":["class"],"type":"string"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"methods":{"default":"none","description":"List of methods.","items":{"$ref":"#/definitions/Method"},"type":"array"},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (`foo.bar.baz`).\\n\\nWhen undefined, the type is located at the root of the assembly (its\\n`fqn` would be like `.`).\\n\\nFor types inside other types or inside submodules, the `` corresponds to\\nthe namespace-qualified name of the container (can contain multiple segments like:\\n`..`).\\n\\nIn all cases:\\n\\n = [.].","type":"string"},"properties":{"default":"none","description":"List of properties.","items":{"$ref":"#/definitions/Property"},"type":"array"}},"required":["assembly","fqn","kind","name"],"type":"object"},"CollectionKind":{"description":"Kinds of collections.","enum":["array","map"],"type":"string"},"CollectionTypeReference":{"description":"Reference to a collection type.","properties":{"collection":{"properties":{"elementtype":{"$ref":"#/definitions/TypeReference","description":"The type of an element (map keys are always strings)."},"kind":{"$ref":"#/definitions/CollectionKind","description":"The kind of collection."}},"required":["elementtype","kind"],"type":"object"}},"required":["collection"],"type":"object"},"Docs":{"description":"Key value pairs of documentation nodes.\\nBased on TSDoc.","properties":{"custom":{"additionalProperties":{"type":"string"},"default":"none","description":"Custom tags that are not any of the default ones","type":"object"},"default":{"default":"none","description":"Description of the default","type":"string"},"deprecated":{"default":"none","description":"If present, this block indicates that an API item is no longer supported\\nand may be removed in a future release. The `@deprecated` tag must be\\nfollowed by a sentence describing the recommended alternative.\\nDeprecation recursively applies to members of a container. For example,\\nif a class is deprecated, then so are all of its members.","type":"string"},"example":{"default":"none","description":"Example showing the usage of this API item\\n\\nStarts off in running text mode, may switch to code using fenced code\\nblocks.","type":"string"},"remarks":{"default":"none","description":"Detailed information about an API item.\\n\\nEither the explicitly tagged `@remarks` section, otherwise everything\\npast the first paragraph if there is no `@remarks` tag.","type":"string"},"returns":{"default":"none","description":"The `@returns` block for this doc comment, or undefined if there is not\\none.","type":"string"},"see":{"default":"none","description":"A `@see` link with more information","type":"string"},"stability":{"description":"Whether the API item is beta/experimental quality","enum":["deprecated","experimental","external","stable"],"type":"string"},"subclassable":{"default":false,"description":"Whether this class or interface was intended to be subclassed/implemented\\nby library users.\\n\\nClasses intended for subclassing, and interfaces intended to be\\nimplemented by consumers, are held to stricter standards of API\\ncompatibility.","type":"boolean"},"summary":{"default":"none","description":"Summary documentation for an API item.\\n\\nThe first part of the documentation before hitting a `@remarks` tags, or\\nthe first line of the doc comment block if there is no `@remarks` tag.","type":"string"}},"type":"object"},"EnumMember":{"description":"Represents a member of an enum.","properties":{"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"name":{"description":"The name/symbol of the member.","type":"string"}},"required":["name"],"type":"object"},"EnumType":{"description":"Represents an enum type.","properties":{"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``..``)","minLength":3,"type":"string"},"kind":{"description":"The kind of the type.","enum":["enum"],"type":"string"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"members":{"description":"Members of the enum.","items":{"$ref":"#/definitions/EnumMember"},"type":"array"},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (`foo.bar.baz`).\\n\\nWhen undefined, the type is located at the root of the assembly (its\\n`fqn` would be like `.`).\\n\\nFor types inside other types or inside submodules, the `` corresponds to\\nthe namespace-qualified name of the container (can contain multiple segments like:\\n`..`).\\n\\nIn all cases:\\n\\n = [.].","type":"string"}},"required":["assembly","fqn","kind","members","name"],"type":"object"},"InterfaceType":{"properties":{"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"datatype":{"default":false,"description":"True if this interface only contains properties. Different backends might\\nhave idiomatic ways to allow defining concrete instances such interfaces.\\nFor example, in Java, the generator will produce a PoJo and a builder\\nwhich will allow users to create a concrete object with data which\\nadheres to this interface.","type":"boolean"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``..``)","minLength":3,"type":"string"},"interfaces":{"default":"none","description":"The FQNs of the interfaces this interface extends, if any.","items":{"type":"string"},"type":"array","uniqueItems":true},"kind":{"description":"The kind of the type.","enum":["interface"],"type":"string"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"methods":{"default":"none","description":"List of methods.","items":{"$ref":"#/definitions/Method"},"type":"array"},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (`foo.bar.baz`).\\n\\nWhen undefined, the type is located at the root of the assembly (its\\n`fqn` would be like `.`).\\n\\nFor types inside other types or inside submodules, the `` corresponds to\\nthe namespace-qualified name of the container (can contain multiple segments like:\\n`..`).\\n\\nIn all cases:\\n\\n = [.].","type":"string"},"properties":{"default":"none","description":"List of properties.","items":{"$ref":"#/definitions/Property"},"type":"array"}},"required":["assembly","fqn","kind","name"],"type":"object"},"Method":{"description":"A method with a name (i.e: not an initializer).","properties":{"abstract":{"default":false,"description":"Is this method an abstract method (this means the class will also be an abstract class)","type":"boolean"},"async":{"default":false,"description":"Indicates if this is an asynchronous method (it will return a promise).","type":"boolean"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"name":{"description":"The name of the method. Undefined if this method is a initializer.","type":"string"},"overrides":{"default":"this member is not overriding anything","description":"The FQN of the parent type (class or interface) that this entity\\noverrides or implements. If undefined, then this entity is the first in\\nit\'s hierarchy to declare this entity.","type":"string"},"parameters":{"default":"none","description":"The parameters of the Initializer or Method.","items":{"$ref":"#/definitions/Parameter"},"type":"array"},"protected":{"default":false,"description":"Indicates if this Initializer or Method is protected (otherwise it is\\npublic, since private members are not modeled).","type":"boolean"},"returns":{"$ref":"#/definitions/OptionalValue","default":"void","description":"The return type of the method (`undefined` if `void`)"},"static":{"default":false,"description":"Indicates if this is a static method.","type":"boolean"},"variadic":{"default":false,"description":"Indicates whether this Initializer or Method is variadic or not. When\\n``true``, the last element of ``#parameters`` will also be flagged\\n``#variadic``.","type":"boolean"}},"required":["name"],"type":"object"},"NamedTypeReference":{"description":"Reference to a named type, defined by this assembly or one of its\\ndependencies.","properties":{"fqn":{"description":"The fully-qualified-name of the type (can be located in the\\n``spec.types[fqn]``` of the assembly that defines the type).","type":"string"}},"required":["fqn"],"type":"object"},"OptionalValue":{"description":"A value that can possibly be optional.","properties":{"optional":{"default":false,"description":"Determines whether the value is, indeed, optional.","type":"boolean"},"type":{"$ref":"#/definitions/TypeReference","description":"The declared type of the value, when it\'s present."}},"required":["type"],"type":"object"},"Parameter":{"description":"Represents a method parameter.","properties":{"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"name":{"description":"The name of the parameter.","minLength":1,"type":"string"},"optional":{"default":false,"description":"Determines whether the value is, indeed, optional.","type":"boolean"},"type":{"$ref":"#/definitions/TypeReference","description":"The declared type of the value, when it\'s present."},"variadic":{"default":false,"description":"Whether this is the last parameter of a variadic method. In such cases,\\nthe `#type` attribute is the type of each individual item of the variadic\\narguments list (as opposed to some array type, as for example TypeScript\\nwould model it).","type":"boolean"}},"required":["name","type"],"type":"object"},"Person":{"description":"Metadata about people or organizations associated with the project that\\nresulted in the Assembly. Some of this metadata is required in order to\\npublish to certain package repositories (for example, Maven Central), but is\\nnot normalized, and the meaning of fields (role, for example), is up to each\\nproject maintainer.","properties":{"email":{"default":"none","description":"The email of the person","type":"string"},"name":{"description":"The name of the person","type":"string"},"organization":{"default":false,"description":"If true, this person is, in fact, an organization","type":"boolean"},"roles":{"description":"A list of roles this person has in the project, for example `maintainer`,\\n`contributor`, `owner`, ...","items":{"type":"string"},"type":"array"},"url":{"default":"none","description":"The URL for the person","type":"string"}},"required":["name","roles"],"type":"object"},"PrimitiveType":{"description":"Kinds of primitive types.","enum":["any","boolean","date","json","number","string"],"type":"string"},"PrimitiveTypeReference":{"description":"Reference to a primitive type.","properties":{"primitive":{"$ref":"#/definitions/PrimitiveType","description":"If this is a reference to a primitive type, this will include the\\nprimitive type kind."}},"required":["primitive"],"type":"object"},"Property":{"description":"A class property.","properties":{"abstract":{"default":false,"description":"Indicates if this property is abstract","type":"boolean"},"const":{"default":false,"description":"A hint that indicates that this static, immutable property is initialized\\nduring startup. This allows emitting \\"const\\" idioms in different target\\nlanguages. Implies `static` and `immutable`.","type":"boolean"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"immutable":{"default":false,"description":"Indicates if this property only has a getter (immutable).","type":"boolean"},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"name":{"description":"The name of the property.","minLength":1,"type":"string"},"optional":{"default":false,"description":"Determines whether the value is, indeed, optional.","type":"boolean"},"overrides":{"default":"this member is not overriding anything","description":"The FQN of the parent type (class or interface) that this entity\\noverrides or implements. If undefined, then this entity is the first in\\nit\'s hierarchy to declare this entity.","type":"string"},"protected":{"default":false,"description":"Indicates if this property is protected (otherwise it is public)","type":"boolean"},"static":{"default":false,"description":"Indicates if this is a static property.","type":"boolean"},"type":{"$ref":"#/definitions/TypeReference","description":"The declared type of the value, when it\'s present."}},"required":["name","type"],"type":"object"},"ReadMe":{"description":"README information","properties":{"markdown":{"type":"string"}},"required":["markdown"],"type":"object"},"SourceLocatable":{"description":"Indicates that an entity has a source location","properties":{"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."}},"type":"object"},"SourceLocation":{"description":"Where in the module source the definition for this API item was found","properties":{"filename":{"description":"Relative filename","type":"string"},"line":{"description":"1-based line number in the indicated file","type":"number"}},"required":["filename","line"],"type":"object"},"Targetable":{"description":"A targetable module-like thing\\n\\nHas targets and a readme. Used for Assemblies and Submodules.","properties":{"readme":{"$ref":"#/definitions/ReadMe","default":"none","description":"The readme document for this module (if any)."},"targets":{"$ref":"#/definitions/AssemblyTargets","default":"none","description":"A map of target name to configuration, which is used when generating\\npackages for various languages."}},"type":"object"},"TypeBase":{"description":"Common attributes of a type definition.","properties":{"assembly":{"description":"The name of the assembly the type belongs to.","minLength":1,"type":"string"},"docs":{"$ref":"#/definitions/Docs","default":"none","description":"Documentation for this entity."},"fqn":{"description":"The fully qualified name of the type (``..``)","minLength":3,"type":"string"},"kind":{"$ref":"#/definitions/TypeKind","description":"The kind of the type."},"locationInModule":{"$ref":"#/definitions/SourceLocation","default":"none","description":"Where in the module this definition was found\\n\\nWhy is this not `locationInAssembly`? Because the assembly is the JSII\\nfile combining compiled code and its manifest, whereas this is referring\\nto the location of the source in the module the assembly was built from."},"name":{"description":"The simple name of the type (MyClass).","minLength":1,"type":"string"},"namespace":{"default":"none","description":"The namespace of the type (`foo.bar.baz`).\\n\\nWhen undefined, the type is located at the root of the assembly (its\\n`fqn` would be like `.`).\\n\\nFor types inside other types or inside submodules, the `` corresponds to\\nthe namespace-qualified name of the container (can contain multiple segments like:\\n`..`).\\n\\nIn all cases:\\n\\n = [.].","type":"string"}},"required":["assembly","fqn","kind","name"],"type":"object"},"TypeKind":{"description":"Kinds of types.","enum":["class","enum","interface"],"type":"string"},"TypeReference":{"anyOf":[{"$ref":"#/definitions/NamedTypeReference"},{"$ref":"#/definitions/PrimitiveTypeReference"},{"$ref":"#/definitions/CollectionTypeReference"},{"$ref":"#/definitions/UnionTypeReference"}],"description":"A reference to a type (primitive, collection or fqn)."},"UnionTypeReference":{"description":"Reference to a union type.","properties":{"union":{"description":"Indicates that this is a union type, which means it can be one of a set\\nof types.","properties":{"types":{"description":"All the possible types (including the primary type).","items":{"$ref":"#/definitions/TypeReference"},"minItems":2,"type":"array"}},"required":["types"],"type":"object"}},"required":["union"],"type":"object"}}}'); }, 2357: module => { "use strict"; diff --git a/internal/embedded/resources/lib/program.js.map b/internal/embedded/resources/lib/program.js.map index 57c3c11..13e9469 100644 --- a/internal/embedded/resources/lib/program.js.map +++ b/internal/embedded/resources/lib/program.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/at-least-node/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/chownr/chownr.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/copy-sync/copy-sync.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/copy-sync/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/copy/copy.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/copy/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/empty/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/file.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/link.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/symlink-paths.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/symlink-type.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/symlink.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/fs/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/json/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/json/jsonfile.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/json/output-json-sync.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/json/output-json.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/mkdirs/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/mkdirs/make-dir.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/move-sync/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/move-sync/move-sync.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/move/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/move/move.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/output/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/path-exists/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/remove/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/remove/rimraf.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/util/stat.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/util/utimes.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/node_modules/universalify/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-minipass/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/graceful-fs/clone.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/graceful-fs/graceful-fs.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/graceful-fs/legacy-streams.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/graceful-fs/polyfills.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonfile/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonfile/node_modules/universalify/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonfile/utils.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/attribute.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/helpers.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/scan.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/validator.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/minipass/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/minizlib/constants.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/minizlib/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/find-made.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/mkdirp-manual.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/mkdirp-native.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/opts-arg.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/path-arg.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/use-native.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/create.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/extract.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/get-write-flag.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/header.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/high-level-opt.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/large-numbers.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/list.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/mkdir.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/mode-fix.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/pack.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/parse.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/path-reservations.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/pax.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/read-entry.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/replace.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/types.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/unpack.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/update.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/warn-mixin.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/winchars.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/write-entry.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/yallist/iterator.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/yallist/yallist.js","webpack://@jsii/runtime/../kernel/lib/api.ts","webpack://@jsii/runtime/../kernel/lib/index.ts","webpack://@jsii/runtime/../kernel/lib/kernel.ts","webpack://@jsii/runtime/../kernel/lib/objects.ts","webpack://@jsii/runtime/../kernel/lib/on-exit.ts","webpack://@jsii/runtime/../kernel/lib/serialization.ts","webpack://@jsii/runtime/./lib/host.ts","webpack://@jsii/runtime/./lib/in-out.ts","webpack://@jsii/runtime/./lib/sync-stdio.ts","webpack://@jsii/runtime/../spec/lib/assembly.ts","webpack://@jsii/runtime/../spec/lib/index.ts","webpack://@jsii/runtime/../spec/lib/name-tree.ts","webpack://@jsii/runtime/../spec/lib/validate-assembly.ts","webpack://@jsii/runtime/external \"assert\"","webpack://@jsii/runtime/external \"buffer\"","webpack://@jsii/runtime/external \"child_process\"","webpack://@jsii/runtime/external \"constants\"","webpack://@jsii/runtime/external \"crypto\"","webpack://@jsii/runtime/external \"events\"","webpack://@jsii/runtime/external \"fs\"","webpack://@jsii/runtime/external \"module\"","webpack://@jsii/runtime/external \"os\"","webpack://@jsii/runtime/external \"path\"","webpack://@jsii/runtime/external \"process\"","webpack://@jsii/runtime/external \"stream\"","webpack://@jsii/runtime/external \"string_decoder\"","webpack://@jsii/runtime/external \"url\"","webpack://@jsii/runtime/external \"util\"","webpack://@jsii/runtime/external \"vm\"","webpack://@jsii/runtime/external \"zlib\"","webpack://@jsii/runtime/webpack/bootstrap","webpack://@jsii/runtime/webpack/runtime/node module decorator","webpack://@jsii/runtime/./lib/program.ts"],"names":["module","exports","r","n","process","versions","node","split","map","x","parseInt","fs","path","LCHOWN","lchown","LCHOWNSYNC","lchownSync","needEISDIRHandled","version","match","uid","gid","er","code","chownSync","handleEISDIR","cb","chown","_","__","___","handleEISDirSync","nodeVersion","readdir","options","readdirSync","test","cpath","chownrKid","p","child","lstat","resolve","stats","name","isDirectory","chownr","withFileTypes","children","length","len","errState","then","forEach","chownrKidSync","lstatSync","chownrSync","sync","mkdirsSync","utimesMillisSync","stat","copySync","src","dest","opts","filter","clobber","overwrite","preserveTimestamps","arch","console","warn","checkPathsSync","checkParentPathsSync","srcStat","handleFilterAndCopy","destStat","destParent","dirname","existsSync","startCopy","getStats","statSync","dereference","onDir","isFile","isCharacterDevice","isBlockDevice","onFile","isSymbolicLink","onLink","copyFile","mayCopyFile","unlinkSync","errorOnExist","Error","copyFileSync","handleTimestamps","mode","setDestMode","srcMode","fileIsNotWritable","makeFileWritable","setDestTimestamps","chmodSync","updatedSrcStat","atime","mtime","mkDirAndCopy","copyDir","mkdirSync","item","copyDirItem","srcItem","join","destItem","resolvedSrc","readlinkSync","cwd","symlinkSync","resolvedDest","err","isSrcSubdir","copyLink","mkdirs","pathExists","utimesMillis","copy","checkPaths","checkParentPaths","handleFilter","checkParentDir","dirExists","onInclude","Promise","include","error","unlink","handleTimestampsAndMode","setDestTimestampsAndMode","chmod","mkdir","items","copyDirItems","pop","readlink","symlink","u","remove","emptyDir","dir","callback","deleteItem","emptyDirSync","removeSync","emptydirSync","emptydir","createFile","file","makeFile","writeFile","createFileSync","writeFileSync","link","ensureFile","ensureFileSync","createLink","createLinkSync","ensureLink","ensureLinkSync","createSymlink","createSymlinkSync","ensureSymlink","ensureSymlinkSync","srcpath","dstpath","makeLink","destinationExists","message","replace","undefined","linkSync","symlinkPaths","isAbsolute","toCwd","toDst","dstdir","relativeToDst","exists","relative","symlinkPathsSync","symlinkType","type","symlinkTypeSync","_mkdirs","_symlinkPaths","_symlinkType","api","key","Object","keys","method","filename","read","fd","buffer","offset","position","reject","bytesRead","write","args","bytesWritten","writev","buffers","realpath","native","getOwnPropertyDescriptor","defineProperty","promises","jsonFile","outputJson","outputJsonSync","outputJSON","outputJSONSync","writeJSON","writeJson","writeJSONSync","writeJsonSync","readJSON","readJson","readJSONSync","readJsonSync","readFile","readFileSync","data","str","stringify","outputFileSync","async","outputFile","makeDir","_makeDir","makeDirSync","mkdirp","mkdirpSync","ensureDir","ensureDirSync","atLeastNode","useNativeRecursiveOption","checkPath","pth","platform","pathHasInvalidWinCharacters","parse","root","processOptions","defaults","permissionError","errno","syscall","input","recursive","make","includes","moveSync","doRename","rename","renameSync","moveAcrossDevice","move","destExists","encoding","itDoes","access","catch","pathExistsSync","rimraf","assert","isWindows","methods","m","maxBusyTries","busyTries","strictEqual","rimraf_","CB","time","setTimeout","st","fixWinEPERM","rmdir","er2","er3","fixWinEPERMSync","rmdirSync","originalEr","rmkids","files","f","rimrafSync","rmkidsSync","startTime","Date","now","ret","util","nodeSupportsBigInt","bigint","all","getStatsSync","funcName","callbackify","areIdentical","errMsg","srcParent","ino","dev","Number","MAX_SAFE_INTEGER","size","nlink","atimeMs","mtimeMs","ctimeMs","birthtimeMs","srcArr","sep","i","destArr","reduce","acc","cur","open","futimes","futimesErr","close","closeErr","openSync","futimesSync","closeSync","fn","apply","this","call","res","value","slice","MiniPass","EE","binding","FSReqWrap","FSReqCallback","iovec","pos","done","bw","req","oncomplete","writeBuffers","_autoClose","Symbol","_close","_ended","_fd","_finished","_flags","_flush","_handleChunk","_makeBuf","_mode","_needDrain","_onerror","_onopen","_onread","_onwrite","_open","_path","_pos","_queue","_read","_readSize","_reading","_remain","_size","_write","_writing","_defaultFlag","_errored","ReadStream","opt","super","readable","writable","TypeError","readSize","Infinity","autoClose","emit","Buffer","allocUnsafe","Math","min","buf","nextTick","br","end","ev","ReadStreamSync","threw","readSync","WriteStream","start","defaultFlag","flags","enc","from","push","WriteStreamSync","writeSync","clone","getPrototypeOf","obj","__proto__","create","getOwnPropertyNames","polyfills","legacy","gracefulQueue","previousSymbol","for","noop","publishQueue","context","queue","get","debug","debuglog","env","NODE_DEBUG","format","arguments","global","fs$close","retry","fs$closeSync","on","patch","TEST_GRACEFUL_FS_GLOBAL_PATCH","__patched","gracefulify","createReadStream","createWriteStream","fs$readFile","go$readFile","enqueue","fs$writeFile","go$writeFile","fs$appendFile","appendFile","go$appendFile","fs$copyFile","fs$readdir","go$readdir$cb","go$readdir","sort","substr","legStreams","fs$ReadStream","prototype","ReadStream$open","fs$WriteStream","WriteStream$open","set","val","enumerable","configurable","FileReadStream","FileWriteStream","that","destroy","fs$open","go$open","elem","shift","Stream","self","paused","bufferSize","index","setEncoding","busy","flush","constants","origCwd","GRACEFUL_FS_PLATFORM","chdir","d","setPrototypeOf","hasOwnProperty","patchLchmod","lutimes","patchLutimes","chownFix","fchown","chmodFix","fchmod","lchmod","chownFixSync","fchownSync","chmodFixSync","fchmodSync","lchmodSync","statFix","fstat","statFixSync","fstatSync","fs$rename","to","backoff","stater","fs$read","callback_","eagCounter","fs$readSync","O_WRONLY","O_SYMLINK","err2","at","mt","lutimesSync","_a","_b","_c","orig","target","chownErOk","nonroot","getuid","_fs","universalify","_readFile","shouldThrow","throws","fromCallback","stripBom","JSON","reviver","fromPromise","content","_writeFile","jsonfile","EOF","finalEOL","EOL","replacer","spaces","isBuffer","toString","helpers","ValidatorResult","SchemaError","attribute","ignoreProperties","validators","validateType","instance","schema","ctx","result","types","Array","isArray","some","testType","bind","list","v","id","$id","addError","argument","testSchemaNoThrow","throwError","throwAll","validateSchema","valid","Function","anyOf","validateAnyOf","inner","importErrors","title","nestedErrors","allOf","validateAllOf","msg","errors","oneOf","validateOneOf","count","if","validateIf","isSchema","ifValid","makeChild","else","getEnumerableProperty","object","propertyIsEnumerable","propertyNames","validatePropertyNames","subschema","property","properties","validateProperties","preValidateProperty","prop","testAdditionalProperty","additionalProperties","patternProperties","validatePatternProperties","pattern","regexp","RegExp","_e","validateAdditionalProperties","minProperties","validateMinProperties","maxProperties","validateMaxProperties","validateItems","array","every","additionalItems","minimum","validateMinimum","number","exclusiveMinimum","maximum","validateMaximum","exclusiveMaximum","validateExclusiveMinimum","validateExclusiveMaximum","validateMultipleOfOrDivisbleBy","validationType","errorMessage","validationArgument","instanceDecimals","getDecimalPlaces","divisorDecimals","maxDecimals","max","multiplier","pow","round","multipleOf","validateMultipleOf","divisibleBy","validateDivisibleBy","required","validateRequired","validatePattern","string","validateFormat","disableFormat","isFormat","minLength","validateMinLength","hsp","maxLength","validateMaxLength","minItems","validateMinItems","maxItems","validateMaxItems","testArrays","a","j","deepCompareStrict","uniqueItems","validateUniqueItems","dependencies","validateDependencies","dep","childContext","propertyPath","validateEnum","String","not","disallow","validateNot","notTypes","schemaId","uri","ValidationError","sum","makeSuffix","stack","throwFirst","detail","ValidatorResultError","validatorType","stringizer","captureStackTrace","constructor","SchemaContext","base","schemas","propertyName","concat","FORMAT_REGEXPS","parseFloat","isNaN","e","regex","ipv4","validator","customFormats","b","aKeys","bKeys","deepMerger","dst","deepMerge","indexOf","copyist","copyistWithDeepMerge","objectGetPath","o","s","parts","k","decodeURIComponent","pathEncoder","encodeURIComponent","encodePath","encodePointer","decimalPlaces","decimalParts","Validator","SchemaScanResult","scan","validate","urilib","found","ref","scanSchema","baseuri","$ref","resolvedUri","ourBase","substring","scanArray","extends","scanObject","definitions","anonymousBase","unresolvedRefs","attributes","addSchema","ourUri","addSubSchemaArray","addSubSchema","addSubSchemaObject","setSchemas","getSchema","urn","sch","shouldResolve","schemaobj","schemaTraverser","superResolve","switchSchema","resolved","subctx","skipAttributes","validatorErr","allowUnknownAttributes","rewrite","parsed","fragment","hash","document","testString","testNumber","isFinite","integer","testInteger","boolean","testBoolean","testArray","testNull","date","testDate","any","testAny","testObject","Yallist","SD","MAYBE_EMIT_END","EMITTED_END","EMITTING_END","CLOSED","READ","FLUSH","FLUSHCHUNK","ENCODING","DECODER","FLOWING","PAUSED","RESUME","BUFFERLENGTH","BUFFERPUSH","BUFFERSHIFT","OBJECTMODE","DESTROYED","doIter","_MP_NO_ITERATOR_SYMBOLS_","ASYNCITERATOR","asyncIterator","ITERATOR","iterator","isEndish","isArrayBuffer","ArrayBuffer","byteLength","isArrayBufferView","isView","Minipass","pipes","objectMode","lastNeed","chunk","om","assign","byteOffset","flowing","head","once","noDrain","ended","stdout","stderr","ondrain","removeAllListeners","pause","removeListener","dataLength","promise","c","collect","next","onerr","ondata","onend","ondestroy","rej","pipe","realZlibConstants","ZLIB_VERNUM","freeze","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_ERRNO","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","Z_BUF_ERROR","Z_VERSION_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","DEFLATE","INFLATE","GZIP","GUNZIP","DEFLATERAW","INFLATERAW","UNZIP","BROTLI_DECODE","BROTLI_ENCODE","Z_MIN_WINDOWBITS","Z_MAX_WINDOWBITS","Z_DEFAULT_WINDOWBITS","Z_MIN_CHUNK","Z_MAX_CHUNK","Z_DEFAULT_CHUNK","Z_MIN_MEMLEVEL","Z_MAX_MEMLEVEL","Z_DEFAULT_MEMLEVEL","Z_MIN_LEVEL","Z_MAX_LEVEL","Z_DEFAULT_LEVEL","BROTLI_OPERATION_PROCESS","BROTLI_OPERATION_FLUSH","BROTLI_OPERATION_FINISH","BROTLI_OPERATION_EMIT_METADATA","BROTLI_MODE_GENERIC","BROTLI_MODE_TEXT","BROTLI_MODE_FONT","BROTLI_DEFAULT_MODE","BROTLI_MIN_QUALITY","BROTLI_MAX_QUALITY","BROTLI_DEFAULT_QUALITY","BROTLI_MIN_WINDOW_BITS","BROTLI_MAX_WINDOW_BITS","BROTLI_LARGE_MAX_WINDOW_BITS","BROTLI_DEFAULT_WINDOW","BROTLI_MIN_INPUT_BLOCK_BITS","BROTLI_MAX_INPUT_BLOCK_BITS","BROTLI_PARAM_MODE","BROTLI_PARAM_QUALITY","BROTLI_PARAM_LGWIN","BROTLI_PARAM_LGBLOCK","BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING","BROTLI_PARAM_SIZE_HINT","BROTLI_PARAM_LARGE_WINDOW","BROTLI_PARAM_NPOSTFIX","BROTLI_PARAM_NDIRECT","BROTLI_DECODER_RESULT_ERROR","BROTLI_DECODER_RESULT_SUCCESS","BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT","BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT","BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION","BROTLI_DECODER_PARAM_LARGE_WINDOW","BROTLI_DECODER_NO_ERROR","BROTLI_DECODER_SUCCESS","BROTLI_DECODER_NEEDS_MORE_INPUT","BROTLI_DECODER_NEEDS_MORE_OUTPUT","BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE","BROTLI_DECODER_ERROR_FORMAT_RESERVED","BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE","BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET","BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME","BROTLI_DECODER_ERROR_FORMAT_CL_SPACE","BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE","BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT","BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1","BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2","BROTLI_DECODER_ERROR_FORMAT_TRANSFORM","BROTLI_DECODER_ERROR_FORMAT_DICTIONARY","BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS","BROTLI_DECODER_ERROR_FORMAT_PADDING_1","BROTLI_DECODER_ERROR_FORMAT_PADDING_2","BROTLI_DECODER_ERROR_FORMAT_DISTANCE","BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET","BROTLI_DECODER_ERROR_INVALID_ARGUMENTS","BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES","BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS","BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP","BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1","BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2","BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES","BROTLI_DECODER_ERROR_UNREACHABLE","realZlib","OriginalBufferConcat","_superWrite","ZlibError","_opts","_flushFlag","_finishFlushFlag","_fullFlushFlag","_handle","_onError","_sawError","_level","_strategy","_defaultFullFlush","ZlibBase","finishFlush","reset","flushFlag","alloc","nativeHandle","originalNativeClose","originalClose","_processChunk","writeReturn","Zlib","level","strategy","params","origFlush","Deflate","Inflate","_portable","Gzip","portable","Gunzip","DeflateRaw","InflateRaw","Unzip","Brotli","BrotliCompress","BrotliDecompress","optsArg","pathArg","useNative","mkdirpNative","mkdirpManual","useNativeSync","mkdirpNativeSync","mkdirpManualSync","manual","nativeSync","manualSync","findMade","parent","statAsync","findMadeSync","made","mkdirAsync","promisify","__TESTING_MKDIRP_PLATFORM__","badWinChars","__TESTING_MKDIRP_NODE_VERSION__","versArr","hasNative","t","update","extract","Pack","Unpack","Parse","ReadEntry","WriteEntry","Header","Pax","hlo","fsm","opt_","createSync","Sync","stream","addFilesSync","addFilesAsync","charAt","noResume","onentry","entry","add","filesFilter","extractFileSync","extractFile","extractSync","Map","mapHas","has","maxReadSize","__FAKE_PLATFORM__","__FAKE_TESTING_FS__","fMapEnabled","UV_FS_O_FILEMAP","fMapLimit","fMapFlag","O_TRUNC","O_CREAT","pathModule","large","SLURP","TYPE","off","ex","gex","cksumValid","needPax","nullBlock","block","cksum","linkpath","uname","gname","devmaj","devmin","ctime","decode","decString","decNumber","decDate","prefix","prefixSize","splitPrefix","encString","encNumber","encDate","charCodeAt","pathSize","pp","basename","numToDate","num","decSmallNumber","nanNull","trim","MAXNUM","12","8","encode","encSmallNumber","octalString","padOctal","floor","getTime","NULLS","argmap","kv","isSafeInteger","encodeNegative","encodePositive","flipped","byte","onesComp","twosComp","pre","twos","Parser","onentryFunction","listFileSync","listFile","resume","SymlinkError","CwdError","umask","needChmod","doChown","processUid","processGid","preserve","cache","created","sub","mkdir_","part","onmkdir","statEr","ok","isDir","PackJob","absolute","pending","ignore","piped","zlib","WriteEntrySync","WriteEntryTar","Tar","ONSTAT","ENDED","QUEUE","CURRENT","PROCESS","PROCESSING","PROCESSJOB","JOBS","JOBDONE","ADDFSENTRY","ADDTARENTRY","STAT","READDIR","ONREADDIR","PIPE","ENTRY","ENTRYOPT","WRITEENTRYCLASS","WRITE","ONDRAIN","warner","preservePaths","strict","noPax","linkCache","statCache","readdirCache","onwarn","zip","gzip","noDirRecurse","follow","noMtime","jobs","job","entries","w","removeNode","source","PackSync","maxMetaEntrySize","Entry","gzipHeader","STATE","WRITEENTRY","READENTRY","NEXTENTRY","PROCESSENTRY","EX","GEX","META","EMITMETA","BUFFER","EMITTEDEND","EMIT","CONSUMECHUNK","CONSUMECHUNKSUB","CONSUMEBODY","CONSUMEMETA","CONSUMEHEADER","CONSUMING","BUFFERCONCAT","MAYBEEND","WRITING","ABORTED","DONE","SAW_VALID_ENTRY","SAW_NULL_BLOCK","SAW_EOF","ondone","header","remain","invalid","meta","go","emittedEnd","re","drainNow","blockRemain","extra","recoverable","abort","have","queues","reservations","getDirs","running","Set","getQueues","paths","dirs","check","q","run","clear","equal","delete","reserve","charset","comment","body","encodeBody","bodyLen","bufLen","ceil","encodeField","field","byteLen","digits","log","g","merge","parseKV","parseKVLine","line","extended","globalExtended","startBlockSize","writeLen","replaceSync","headBuf","POSITION","bufPos","bytes","h","entryBlockSize","mtimeCache","streamSync","getPos","cb_","onread","flag","onopen","wc","pathReservations","ONENTRY","CHECKFS","CHECKFS2","ISREUSABLE","MAKEFS","FILE","DIRECTORY","LINK","SYMLINK","HARDLINK","UNSUPPORTED","CHECKPATH","MKDIR","ONERROR","PENDING","PEND","UNPEND","MAYBECLOSE","SKIP","DOCHOWN","UID","GID","crypto","getFlag","neverCalled","unlinkFile","randomBytes","unlinkFileSync","uint32","transform","dirCache","preserveOwner","setOwner","getgid","forceChown","win32","newer","keep","strip","processUmask","noChmod","dmode","fmode","linkparts","fullyDone","actions","abs","utimes","tx","unsupported","UnpackSync","oner","closeError","futimeser","utimesSync","utimeser","fchowner","chowner","mtimeFilter","Base","tarCode","raw","win","char","fromCharCode","toWin","toRaw","HEADER","LSTAT","ONLSTAT","ONREAD","ONREADLINK","OPENFILE","ONOPENFILE","CLOSE","MODE","winchars","modeFix","myuid","myuser","USER","pathWarn","getType","linkKey","blockLen","writeBuf","readEntry","walker","Node","tail","l","prev","unshiftNode","pushNode","unshift","thisp","forEachReverse","getReverse","mapReverse","initial","reduceReverse","toArray","arr","toArrayReverse","sliceReverse","splice","deleteCount","nodes","insert","reverse","inserted","TOKEN_REF","TOKEN_INTERFACES","TOKEN_DATE","TOKEN_ENUM","TOKEN_MAP","TOKEN_STRUCT","isObjRef","isWireDate","isWireEnum","isWireMap","isWireStruct","isMethodOverride","isPropertyOverride","Kernel","callbackHandler","traceEnabled","assemblies","objects","ObjectTable","_typeInfoForFqn","cbs","waiting","nextid","moduleLoad","nodeRequire","sandbox","vm","createContext","setImmediate","require","_debug","pkgname","pkgver","packageDir","_getPackageDir","epkg","assm","assembly","metadata","originalUmask","tar","tarball","jsiiMetadataFile","spec","SPEC_FILE_NAME","assmSpec","closure","_execute","Assembly","_addAssembly","bin","scriptPath","script","cp","spawnSync","NODE_OPTIONS","execArgv","PATH","execPath","shell","status","signal","_create","objref","deleteObject","symbol","fqn","ti","_typeInfoForProperty","static","_findSymbol","_ensureSync","_wrapSandboxCode","_fromSandbox","immutable","_toSandbox","findObject","interfaces","propertyToGet","_findPropertyTarget","propInfo","propertyToSet","_findInvokeTarget","_toSandboxValues","parameters","returns","_typeInfoForMethod","syncInProgress","prid","_makeprid","promiseid","_req","cbid","cookie","override","invoke","callbacks","fail","sandoxResult","expectedReturnType","succeed","assemblyName","_assemblyFor","targets","naming","objectCount","typedef","kind","TypeKind","Interface","Class","Enum","tagJsiiConstructor","wire","EMPTY_OBJECT_FQN","ctor","typeinfo","classType","_validateMethodArguments","initializer","installDir","mkdtempSync","os","tmpdir","onExit","requestArgs","ctorResult","_findCtor","registerObject","overrides","overrideTypeErrorMessage","_applyMethodOverride","_applyPropertyOverride","typeFqn","_tryTypeInfoForMethod","_tryTypeInfoForProperty","CANONICAL_ANY","_defineOverridenProperty","getPropertyDescriptor","prevEnumerable","_getSuperPropertyName","_makecbid","direct","proto","methodInfo","variadic","_defineOverridenMethod","methodName","methodArgs","_fromSandboxValues","param","arg","optional","describeTypeReference","curr","components","moduleName","fqnInfo","addendum","classFqn","bases","typeInfo","isClassType","classTypeInfo","isInterfaceType","interfaceTypeInfo","baseFqn","expectedType","serTypes","serializationType","host","findSymbol","lookupType","recurse","SERIALIZERS","serializationClass","deserialize","typeRef","targetType","serialize","xs","_boxUnboxParameters","boxUnbox","desc","superProp","Script","runInContext","displayErrors","OBJID_SYMBOL","IFACES_SYMBOL","JSII_SYMBOL","jsiiTypeFqn","objectReference","tagObject","objid","managed","resolveType","existingRef","allIfaces","iface","removeRedundant","makeId","builtIn","InterfaceCollection","addFromClass","addFromInterface","removeSyncPaths","registerIfNeeded","registered","onExitHandler","SYMBOL_WIRE_TYPE","_type","optionalValue","nullAndOk","isDate","serializeDate","deserializeDate","primitiveType","isScalar","primitive","collection","CollectionKind","elementtype","PrimitiveType","Json","mapJsonValue","mapValues","toMap","enumType","enumMap","enumEntry","find","deserializeEnum","arrayType","mapType","namedType","props","propertiesOf","validateRequiredProps","isAssignable","jsiiType","namedTypeRef","declaredType","prevRef","isByReferenceOnly","mapOfAny","toISOString","lookup","enumLocator","lastIndexOf","typeName","valueName","enumValue","isPrimitiveTypeReference","Any","Boolean","isCollectionTypeReference","isUnionTypeReference","compoundTypes","flatMap","union","compareSerializationClasses","isEnumType","datatype","out","wireValue","isClassOrInterfaceType","actualTypeFqn","requiredType","actualType","actualProps","specProps","missingRequiredProps","order","descr","KernelHost","inout","kernel","eventEmitter","EventEmitter","exit","processRequest","event","listener","completeCallback","completeReq","complete","apiReq","findApi","checkIfAsyncIsAllowed","writeOkay","isPromise","writeError","noStack","apiName","InputOutput","stdio","output","writeLine","writeErrorLine","reqLine","readLine","startsWith","INPUT_BUFFER_SIZE","SyncStdio","bufferedData","readBuffer","errorFD","stdin","readFD","writeFD","writeBuffer","newData","newLinePos","SchemaVersion","Stability","isNamedTypeReference","isMethod","callable","unionType","isDeprecated","entity","docs","stability","Deprecated","NameTree","_children","nameTree","values","register","_fqn","rest","validateAssembly","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","nmd","packageInfo","JSII_NOSTACK","JSII_DEBUG","hello"],"mappings":";;QAAAA,OAAOC,UAAUC;YACf,MAAMC,IAAIC,QAAQC,SAASC,KAAKC,MAAM,KAAKC,KAAIC,KAAKC,SAASD,GAAG;YAChEP,IAAIA,EAAEK,MAAM,KAAKC,KAAIC,KAAKC,SAASD,GAAG;YACtC,OAAON,EAAE,KAAKD,EAAE,MAAOC,EAAE,OAAOD,EAAE,OAAOC,EAAE,KAAKD,EAAE,MAAOC,EAAE,OAAOD,EAAE,MAAMC,EAAE,MAAMD,EAAE;;;;;QCFtF,MAAMS,KAAK,oBAAQ;QACnB,MAAMC,OAAO,oBAAQ;QAGrB,MAAMC,SAASF,GAAGG,SAAS,WAAW;QAEtC,MAAMC,aAAaJ,GAAGK,aAAa,eAAe;QAGlD,MAAMC,oBAAoBN,GAAGG,WAC1BV,QAAQc,QAAQC,MAAM,kBACtBf,QAAQc,QAAQC,MAAM;QAEzB,MAAMH,aAAa,CAACJ,MAAMQ,KAAKC;YAC7B;gBACE,OAAOV,GAAGI,YAAYH,MAAMQ,KAAKC;cACjC,OAAOC;gBACP,IAAIA,GAAGC,SAAS,UACd,MAAMD;;;QAKZ,MAAME,YAAY,CAACZ,MAAMQ,KAAKC;YAC5B;gBACE,OAAOV,GAAGa,UAAUZ,MAAMQ,KAAKC;cAC/B,OAAOC;gBACP,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AG/B,SAASC,oBAAoBC;IAE5B,IAAIC,eAAeH,yBAAyBE;IAC5C,IAAIC,iBAAiB1hD,WAAW;QAC/B,OAAO0hD,aAAa7sD;;IAGrB,IAAID,SAAS2sD,yBAAyBE,YAAY;QACjD3oC,IAAI2oC;QACJE,QAAQ;QACR9sD,SAAS;;IAIV+sD,oBAAoBH,UAAUr3C,KAAKxV,OAAOC,SAASD,QAAQA,OAAOC,SAAS2sD;IAG3E5sD,OAAO+sD,SAAS;IAGhB,OAAO/sD,OAAOC;;;;ICxBf2sD,oBAAoBK,MAAOjtD;QAC1BA,OAAOiuC,QAAQ;QACf,KAAKjuC,OAAOgD,UAAUhD,OAAOgD,WAAW;QACxC,OAAOhD;;;;;;;;;;;;;;ICHR;IAEA;IACA;IACA;IACA;IAEA,MAAM4C,OAAOsqD,YAAYtqD;IACzB,MAAM1B,UAAUgsD,YAAYhsD;IAE5B,MAAMipD,YAAY/pD,QAAQkb,IAAI6xC;IAC9B,MAAM/xC,UAAUhb,QAAQkb,IAAI8xC;IAM5B,MAAM9C,QAAQ,IAAI,aAAAQ,UAAU;QAK1BG,UAAU,KAAA7qD,QAAQu0B,OAAe/nB,QAAE,6BAAI;QACvCu+C,QAAQ;QACRC,SAAS;;IAGX,MAAMlC,QAAQ,IAAI,SAAAmB,YAAYC;IAC9B,MAAM9H,OAAO,IAAI,OAAAyG,WAAWC,OAAO;QAAE9tC;QAAO+uC;;IAE5C3H,KAAKjuB,KAAK,QAAQn0B,QAAQkpD,KAAKvlC,KAAK3jB;IAGpC8oD,MAAMh8C,MAAM;QAAEmgD,OAAO,GAAGzqD,QAAQ1B;;IAChCgoD,MAAM9tC,QAAQA;IAEdonC,KAAKnU","file":"lib/program.js","sourcesContent":["module.exports = r => {\n const n = process.versions.node.split('.').map(x => parseInt(x, 10))\n r = r.split('.').map(x => parseInt(x, 10))\n return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2])))\n}\n","'use strict'\nconst fs = require('fs')\nconst path = require('path')\n\n/* istanbul ignore next */\nconst LCHOWN = fs.lchown ? 'lchown' : 'chown'\n/* istanbul ignore next */\nconst LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync'\n\n/* istanbul ignore next */\nconst needEISDIRHandled = fs.lchown &&\n !process.version.match(/v1[1-9]+\\./) &&\n !process.version.match(/v10\\.[6-9]/)\n\nconst lchownSync = (path, uid, gid) => {\n try {\n return fs[LCHOWNSYNC](path, uid, gid)\n } catch (er) {\n if (er.code !== 'ENOENT')\n throw er\n }\n}\n\n/* istanbul ignore next */\nconst chownSync = (path, uid, gid) => {\n try {\n return fs.chownSync(path, uid, gid)\n } catch (er) {\n if (er.code !== 'ENOENT')\n throw er\n }\n}\n\n/* istanbul ignore next */\nconst handleEISDIR =\n needEISDIRHandled ? (path, uid, gid, cb) => er => {\n // Node prior to v10 had a very questionable implementation of\n // fs.lchown, which would always try to call fs.open on a directory\n // Fall back to fs.chown in those cases.\n if (!er || er.code !== 'EISDIR')\n cb(er)\n else\n fs.chown(path, uid, gid, cb)\n }\n : (_, __, ___, cb) => cb\n\n/* istanbul ignore next */\nconst handleEISDirSync =\n needEISDIRHandled ? (path, uid, gid) => {\n try {\n return lchownSync(path, uid, gid)\n } catch (er) {\n if (er.code !== 'EISDIR')\n throw er\n chownSync(path, uid, gid)\n }\n }\n : (path, uid, gid) => lchownSync(path, uid, gid)\n\n// fs.readdir could only accept an options object as of node v6\nconst nodeVersion = process.version\nlet readdir = (path, options, cb) => fs.readdir(path, options, cb)\nlet readdirSync = (path, options) => fs.readdirSync(path, options)\n/* istanbul ignore next */\nif (/^v4\\./.test(nodeVersion))\n readdir = (path, options, cb) => fs.readdir(path, cb)\n\nconst chown = (cpath, uid, gid, cb) => {\n fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => {\n // Skip ENOENT error\n cb(er && er.code !== 'ENOENT' ? er : null)\n }))\n}\n\nconst chownrKid = (p, child, uid, gid, cb) => {\n if (typeof child === 'string')\n return fs.lstat(path.resolve(p, child), (er, stats) => {\n // Skip ENOENT error\n if (er)\n return cb(er.code !== 'ENOENT' ? er : null)\n stats.name = child\n chownrKid(p, stats, uid, gid, cb)\n })\n\n if (child.isDirectory()) {\n chownr(path.resolve(p, child.name), uid, gid, er => {\n if (er)\n return cb(er)\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n })\n } else {\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n }\n}\n\n\nconst chownr = (p, uid, gid, cb) => {\n readdir(p, { withFileTypes: true }, (er, children) => {\n // any error other than ENOTDIR or ENOTSUP means it's not readable,\n // or doesn't exist. give up.\n if (er) {\n if (er.code === 'ENOENT')\n return cb()\n else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')\n return cb(er)\n }\n if (er || !children.length)\n return chown(p, uid, gid, cb)\n\n let len = children.length\n let errState = null\n const then = er => {\n if (errState)\n return\n if (er)\n return cb(errState = er)\n if (-- len === 0)\n return chown(p, uid, gid, cb)\n }\n\n children.forEach(child => chownrKid(p, child, uid, gid, then))\n })\n}\n\nconst chownrKidSync = (p, child, uid, gid) => {\n if (typeof child === 'string') {\n try {\n const stats = fs.lstatSync(path.resolve(p, child))\n stats.name = child\n child = stats\n } catch (er) {\n if (er.code === 'ENOENT')\n return\n else\n throw er\n }\n }\n\n if (child.isDirectory())\n chownrSync(path.resolve(p, child.name), uid, gid)\n\n handleEISDirSync(path.resolve(p, child.name), uid, gid)\n}\n\nconst chownrSync = (p, uid, gid) => {\n let children\n try {\n children = readdirSync(p, { withFileTypes: true })\n } catch (er) {\n if (er.code === 'ENOENT')\n return\n else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP')\n return handleEISDirSync(p, uid, gid)\n else\n throw er\n }\n\n if (children && children.length)\n children.forEach(child => chownrKidSync(p, child, uid, gid))\n\n return handleEISDirSync(p, uid, gid)\n}\n\nmodule.exports = chownr\nchownr.sync = chownrSync\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirsSync = require('../mkdirs').mkdirsSync\nconst utimesMillisSync = require('../util/utimes').utimesMillisSync\nconst stat = require('../util/stat')\n\nfunction copySync (src, dest, opts) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts = opts || {}\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy')\n stat.checkParentPathsSync(src, srcStat, dest, 'copy')\n return handleFilterAndCopy(destStat, src, dest, opts)\n}\n\nfunction handleFilterAndCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n const destParent = path.dirname(dest)\n if (!fs.existsSync(destParent)) mkdirsSync(destParent)\n return startCopy(destStat, src, dest, opts)\n}\n\nfunction startCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n return getStats(destStat, src, dest, opts)\n}\n\nfunction getStats (destStat, src, dest, opts) {\n const statSync = opts.dereference ? fs.statSync : fs.lstatSync\n const srcStat = statSync(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n return mayCopyFile(srcStat, src, dest, opts)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts) {\n if (opts.overwrite) {\n fs.unlinkSync(dest)\n return copyFile(srcStat, src, dest, opts)\n } else if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nfunction copyFile (srcStat, src, dest, opts) {\n fs.copyFileSync(src, dest)\n if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)\n return setDestMode(dest, srcStat.mode)\n}\n\nfunction handleTimestamps (srcMode, src, dest) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)\n return setDestTimestamps(src, dest)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return setDestMode(dest, srcMode | 0o200)\n}\n\nfunction setDestMode (dest, srcMode) {\n return fs.chmodSync(dest, srcMode)\n}\n\nfunction setDestTimestamps (src, dest) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = fs.statSync(src)\n return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)\n if (destStat && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n return copyDir(src, dest, opts)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts) {\n fs.mkdirSync(dest)\n copyDir(src, dest, opts)\n return setDestMode(dest, srcMode)\n}\n\nfunction copyDir (src, dest, opts) {\n fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))\n}\n\nfunction copyDirItem (item, src, dest, opts) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy')\n return startCopy(destStat, srcItem, destItem, opts)\n}\n\nfunction onLink (destStat, src, dest, opts) {\n let resolvedSrc = fs.readlinkSync(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlinkSync(resolvedSrc, dest)\n } else {\n let resolvedDest\n try {\n resolvedDest = fs.readlinkSync(dest)\n } catch (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)\n throw err\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // prevent copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n return copyLink(resolvedSrc, dest)\n }\n}\n\nfunction copyLink (resolvedSrc, dest) {\n fs.unlinkSync(dest)\n return fs.symlinkSync(resolvedSrc, dest)\n}\n\nmodule.exports = copySync\n","'use strict'\n\nmodule.exports = {\n copySync: require('./copy-sync')\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirs = require('../mkdirs').mkdirs\nconst pathExists = require('../path-exists').pathExists\nconst utimesMillis = require('../util/utimes').utimesMillis\nconst stat = require('../util/stat')\n\nfunction copy (src, dest, opts, cb) {\n if (typeof opts === 'function' && !cb) {\n cb = opts\n opts = {}\n } else if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n cb = cb || function () {}\n opts = opts || {}\n\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n stat.checkPaths(src, dest, 'copy', (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'copy', err => {\n if (err) return cb(err)\n if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb)\n return checkParentDir(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction checkParentDir (destStat, src, dest, opts, cb) {\n const destParent = path.dirname(dest)\n pathExists(destParent, (err, dirExists) => {\n if (err) return cb(err)\n if (dirExists) return startCopy(destStat, src, dest, opts, cb)\n mkdirs(destParent, err => {\n if (err) return cb(err)\n return startCopy(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction handleFilter (onInclude, destStat, src, dest, opts, cb) {\n Promise.resolve(opts.filter(src, dest)).then(include => {\n if (include) return onInclude(destStat, src, dest, opts, cb)\n return cb()\n }, error => cb(error))\n}\n\nfunction startCopy (destStat, src, dest, opts, cb) {\n if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb)\n return getStats(destStat, src, dest, opts, cb)\n}\n\nfunction getStats (destStat, src, dest, opts, cb) {\n const stat = opts.dereference ? fs.stat : fs.lstat\n stat(src, (err, srcStat) => {\n if (err) return cb(err)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)\n })\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return copyFile(srcStat, src, dest, opts, cb)\n return mayCopyFile(srcStat, src, dest, opts, cb)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts, cb) {\n if (opts.overwrite) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return copyFile(srcStat, src, dest, opts, cb)\n })\n } else if (opts.errorOnExist) {\n return cb(new Error(`'${dest}' already exists`))\n } else return cb()\n}\n\nfunction copyFile (srcStat, src, dest, opts, cb) {\n fs.copyFile(src, dest, err => {\n if (err) return cb(err)\n if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb)\n return setDestMode(dest, srcStat.mode, cb)\n })\n}\n\nfunction handleTimestampsAndMode (srcMode, src, dest, cb) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) {\n return makeFileWritable(dest, srcMode, err => {\n if (err) return cb(err)\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n })\n }\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode, cb) {\n return setDestMode(dest, srcMode | 0o200, cb)\n}\n\nfunction setDestTimestampsAndMode (srcMode, src, dest, cb) {\n setDestTimestamps(src, dest, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n}\n\nfunction setDestMode (dest, srcMode, cb) {\n return fs.chmod(dest, srcMode, cb)\n}\n\nfunction setDestTimestamps (src, dest, cb) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n fs.stat(src, (err, updatedSrcStat) => {\n if (err) return cb(err)\n return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)\n })\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb)\n if (destStat && !destStat.isDirectory()) {\n return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))\n }\n return copyDir(src, dest, opts, cb)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts, cb) {\n fs.mkdir(dest, err => {\n if (err) return cb(err)\n copyDir(src, dest, opts, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n })\n}\n\nfunction copyDir (src, dest, opts, cb) {\n fs.readdir(src, (err, items) => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n}\n\nfunction copyDirItems (items, src, dest, opts, cb) {\n const item = items.pop()\n if (!item) return cb()\n return copyDirItem(items, item, src, dest, opts, cb)\n}\n\nfunction copyDirItem (items, item, src, dest, opts, cb) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => {\n if (err) return cb(err)\n const { destStat } = stats\n startCopy(destStat, srcItem, destItem, opts, err => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n })\n}\n\nfunction onLink (destStat, src, dest, opts, cb) {\n fs.readlink(src, (err, resolvedSrc) => {\n if (err) return cb(err)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlink(resolvedSrc, dest, cb)\n } else {\n fs.readlink(dest, (err, resolvedDest) => {\n if (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb)\n return cb(err)\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))\n }\n\n // do not copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))\n }\n return copyLink(resolvedSrc, dest, cb)\n })\n }\n })\n}\n\nfunction copyLink (resolvedSrc, dest, cb) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return fs.symlink(resolvedSrc, dest, cb)\n })\n}\n\nmodule.exports = copy\n","'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n copy: u(require('./copy'))\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst remove = require('../remove')\n\nconst emptyDir = u(function emptyDir (dir, callback) {\n callback = callback || function () {}\n fs.readdir(dir, (err, items) => {\n if (err) return mkdir.mkdirs(dir, callback)\n\n items = items.map(item => path.join(dir, item))\n\n deleteItem()\n\n function deleteItem () {\n const item = items.pop()\n if (!item) return callback()\n remove.remove(item, err => {\n if (err) return callback(err)\n deleteItem()\n })\n }\n })\n})\n\nfunction emptyDirSync (dir) {\n let items\n try {\n items = fs.readdirSync(dir)\n } catch {\n return mkdir.mkdirsSync(dir)\n }\n\n items.forEach(item => {\n item = path.join(dir, item)\n remove.removeSync(item)\n })\n}\n\nmodule.exports = {\n emptyDirSync,\n emptydirSync: emptyDirSync,\n emptyDir,\n emptydir: emptyDir\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\n\nfunction createFile (file, callback) {\n function makeFile () {\n fs.writeFile(file, '', err => {\n if (err) return callback(err)\n callback()\n })\n }\n\n fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err\n if (!err && stats.isFile()) return callback()\n const dir = path.dirname(file)\n fs.stat(dir, (err, stats) => {\n if (err) {\n // if the directory doesn't exist, make it\n if (err.code === 'ENOENT') {\n return mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeFile()\n })\n }\n return callback(err)\n }\n\n if (stats.isDirectory()) makeFile()\n else {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdir(dir, err => {\n if (err) return callback(err)\n })\n }\n })\n })\n}\n\nfunction createFileSync (file) {\n let stats\n try {\n stats = fs.statSync(file)\n } catch {}\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n try {\n if (!fs.statSync(dir).isDirectory()) {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdirSync(dir)\n }\n } catch (err) {\n // If the stat call above failed because the directory doesn't exist, create it\n if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)\n else throw err\n }\n\n fs.writeFileSync(file, '')\n}\n\nmodule.exports = {\n createFile: u(createFile),\n createFileSync\n}\n","'use strict'\n\nconst file = require('./file')\nconst link = require('./link')\nconst symlink = require('./symlink')\n\nmodule.exports = {\n // file\n createFile: file.createFile,\n createFileSync: file.createFileSync,\n ensureFile: file.createFile,\n ensureFileSync: file.createFileSync,\n // link\n createLink: link.createLink,\n createLinkSync: link.createLinkSync,\n ensureLink: link.createLink,\n ensureLinkSync: link.createLinkSync,\n // symlink\n createSymlink: symlink.createSymlink,\n createSymlinkSync: symlink.createSymlinkSync,\n ensureSymlink: symlink.createSymlink,\n ensureSymlinkSync: symlink.createSymlinkSync\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction createLink (srcpath, dstpath, callback) {\n function makeLink (srcpath, dstpath) {\n fs.link(srcpath, dstpath, err => {\n if (err) return callback(err)\n callback(null)\n })\n }\n\n pathExists(dstpath, (err, destinationExists) => {\n if (err) return callback(err)\n if (destinationExists) return callback(null)\n fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n return callback(err)\n }\n\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return makeLink(srcpath, dstpath)\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeLink(srcpath, dstpath)\n })\n })\n })\n })\n}\n\nfunction createLinkSync (srcpath, dstpath) {\n const destinationExists = fs.existsSync(dstpath)\n if (destinationExists) return undefined\n\n try {\n fs.lstatSync(srcpath)\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n const dir = path.dirname(dstpath)\n const dirExists = fs.existsSync(dir)\n if (dirExists) return fs.linkSync(srcpath, dstpath)\n mkdir.mkdirsSync(dir)\n\n return fs.linkSync(srcpath, dstpath)\n}\n\nmodule.exports = {\n createLink: u(createLink),\n createLinkSync\n}\n","'use strict'\n\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst pathExists = require('../path-exists').pathExists\n\n/**\n * Function that returns two types of paths, one relative to symlink, and one\n * relative to the current working directory. Checks if path is absolute or\n * relative. If the path is relative, this function checks if the path is\n * relative to symlink or relative to current working directory. This is an\n * initiative to find a smarter `srcpath` to supply when building symlinks.\n * This allows you to determine which path to use out of one of three possible\n * types of source paths. The first is an absolute path. This is detected by\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\n * see if it exists. If it does it's used, if not an error is returned\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\n * relative url. By default Node's `fs.symlink` works by creating a symlink\n * using `dstpath` and expects the `srcpath` to be relative to the newly\n * created symlink. If you provide a `srcpath` that does not exist on the file\n * system it results in a broken symlink. To minimize this, the function\n * checks to see if the 'relative to symlink' source file exists, and if it\n * does it will use it. If it does not, it checks if there's a file that\n * exists that is relative to the current working directory, if does its used.\n * This preserves the expectations of the original fs.symlink spec and adds\n * the ability to pass in `relative to current working direcotry` paths.\n */\n\nfunction symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}\n\nfunction symlinkPathsSync (srcpath, dstpath) {\n let exists\n if (path.isAbsolute(srcpath)) {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('absolute srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n exists = fs.existsSync(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n } else {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('relative srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n }\n }\n}\n\nmodule.exports = {\n symlinkPaths,\n symlinkPathsSync\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction symlinkType (srcpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n if (type) return callback(null, type)\n fs.lstat(srcpath, (err, stats) => {\n if (err) return callback(null, 'file')\n type = (stats && stats.isDirectory()) ? 'dir' : 'file'\n callback(null, type)\n })\n}\n\nfunction symlinkTypeSync (srcpath, type) {\n let stats\n\n if (type) return type\n try {\n stats = fs.lstatSync(srcpath)\n } catch {\n return 'file'\n }\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nmodule.exports = {\n symlinkType,\n symlinkTypeSync\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst _mkdirs = require('../mkdirs')\nconst mkdirs = _mkdirs.mkdirs\nconst mkdirsSync = _mkdirs.mkdirsSync\n\nconst _symlinkPaths = require('./symlink-paths')\nconst symlinkPaths = _symlinkPaths.symlinkPaths\nconst symlinkPathsSync = _symlinkPaths.symlinkPathsSync\n\nconst _symlinkType = require('./symlink-type')\nconst symlinkType = _symlinkType.symlinkType\nconst symlinkTypeSync = _symlinkType.symlinkTypeSync\n\nconst pathExists = require('../path-exists').pathExists\n\nfunction createSymlink (srcpath, dstpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n\n pathExists(dstpath, (err, destinationExists) => {\n if (err) return callback(err)\n if (destinationExists) return callback(null)\n symlinkPaths(srcpath, dstpath, (err, relative) => {\n if (err) return callback(err)\n srcpath = relative.toDst\n symlinkType(relative.toCwd, type, (err, type) => {\n if (err) return callback(err)\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)\n mkdirs(dir, err => {\n if (err) return callback(err)\n fs.symlink(srcpath, dstpath, type, callback)\n })\n })\n })\n })\n })\n}\n\nfunction createSymlinkSync (srcpath, dstpath, type) {\n const destinationExists = fs.existsSync(dstpath)\n if (destinationExists) return undefined\n\n const relative = symlinkPathsSync(srcpath, dstpath)\n srcpath = relative.toDst\n type = symlinkTypeSync(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n const exists = fs.existsSync(dir)\n if (exists) return fs.symlinkSync(srcpath, dstpath, type)\n mkdirsSync(dir)\n return fs.symlinkSync(srcpath, dstpath, type)\n}\n\nmodule.exports = {\n createSymlink: u(createSymlink),\n createSymlinkSync\n}\n","'use strict'\n// This is adapted from https://github.com/normalize/mz\n// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\n\nconst api = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'close',\n 'copyFile',\n 'fchmod',\n 'fchown',\n 'fdatasync',\n 'fstat',\n 'fsync',\n 'ftruncate',\n 'futimes',\n 'lchmod',\n 'lchown',\n 'link',\n 'lstat',\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm',\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile'\n].filter(key => {\n // Some commands are not available on some systems. Ex:\n // fs.opendir was added in Node.js v12.12.0\n // fs.rm was added in Node.js v14.14.0\n // fs.lchown is not available on at least some Linux\n return typeof fs[key] === 'function'\n})\n\n// Export all keys:\nObject.keys(fs).forEach(key => {\n if (key === 'promises') {\n // fs.promises is a getter property that triggers ExperimentalWarning\n // Don't re-export it here, the getter is defined in \"lib/index.js\"\n return\n }\n exports[key] = fs[key]\n})\n\n// Universalify async methods:\napi.forEach(method => {\n exports[method] = u(fs[method])\n})\n\n// We differ from mz/fs in that we still ship the old, broken, fs.exists()\n// since we are a drop-in replacement for the native module\nexports.exists = function (filename, callback) {\n if (typeof callback === 'function') {\n return fs.exists(filename, callback)\n }\n return new Promise(resolve => {\n return fs.exists(filename, resolve)\n })\n}\n\n// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args\n\nexports.read = function (fd, buffer, offset, length, position, callback) {\n if (typeof callback === 'function') {\n return fs.read(fd, buffer, offset, length, position, callback)\n }\n return new Promise((resolve, reject) => {\n fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffer })\n })\n })\n}\n\n// Function signature can be\n// fs.write(fd, buffer[, offset[, length[, position]]], callback)\n// OR\n// fs.write(fd, string[, position[, encoding]], callback)\n// We need to handle both cases, so we use ...args\nexports.write = function (fd, buffer, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.write(fd, buffer, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffer })\n })\n })\n}\n\n// fs.writev only available in Node v12.9.0+\nif (typeof fs.writev === 'function') {\n // Function signature is\n // s.writev(fd, buffers[, position], callback)\n // We need to handle the optional arg, so we use ...args\n exports.writev = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.writev(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffers })\n })\n })\n }\n}\n\n// fs.realpath.native only available in Node v9.2+\nif (typeof fs.realpath.native === 'function') {\n exports.realpath.native = u(fs.realpath.native)\n}\n","'use strict'\n\nmodule.exports = {\n // Export promiseified graceful-fs:\n ...require('./fs'),\n // Export extra methods:\n ...require('./copy-sync'),\n ...require('./copy'),\n ...require('./empty'),\n ...require('./ensure'),\n ...require('./json'),\n ...require('./mkdirs'),\n ...require('./move-sync'),\n ...require('./move'),\n ...require('./output'),\n ...require('./path-exists'),\n ...require('./remove')\n}\n\n// Export fs.promises as a getter property so that we don't trigger\n// ExperimentalWarning before fs.promises is actually accessed.\nconst fs = require('fs')\nif (Object.getOwnPropertyDescriptor(fs, 'promises')) {\n Object.defineProperty(module.exports, 'promises', {\n get () { return fs.promises }\n })\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst jsonFile = require('./jsonfile')\n\njsonFile.outputJson = u(require('./output-json'))\njsonFile.outputJsonSync = require('./output-json-sync')\n// aliases\njsonFile.outputJSON = jsonFile.outputJson\njsonFile.outputJSONSync = jsonFile.outputJsonSync\njsonFile.writeJSON = jsonFile.writeJson\njsonFile.writeJSONSync = jsonFile.writeJsonSync\njsonFile.readJSON = jsonFile.readJson\njsonFile.readJSONSync = jsonFile.readJsonSync\n\nmodule.exports = jsonFile\n","'use strict'\n\nconst jsonFile = require('jsonfile')\n\nmodule.exports = {\n // jsonfile exports\n readJson: jsonFile.readFile,\n readJsonSync: jsonFile.readFileSync,\n writeJson: jsonFile.writeFile,\n writeJsonSync: jsonFile.writeFileSync\n}\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFileSync } = require('../output')\n\nfunction outputJsonSync (file, data, options) {\n const str = stringify(data, options)\n\n outputFileSync(file, str, options)\n}\n\nmodule.exports = outputJsonSync\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFile } = require('../output')\n\nasync function outputJson (file, data, options = {}) {\n const str = stringify(data, options)\n\n await outputFile(file, str, options)\n}\n\nmodule.exports = outputJson\n","'use strict'\nconst u = require('universalify').fromPromise\nconst { makeDir: _makeDir, makeDirSync } = require('./make-dir')\nconst makeDir = u(_makeDir)\n\nmodule.exports = {\n mkdirs: makeDir,\n mkdirsSync: makeDirSync,\n // alias\n mkdirp: makeDir,\n mkdirpSync: makeDirSync,\n ensureDir: makeDir,\n ensureDirSync: makeDirSync\n}\n","// Adapted from https://github.com/sindresorhus/make-dir\n// Copyright (c) Sindre Sorhus (sindresorhus.com)\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict'\nconst fs = require('../fs')\nconst path = require('path')\nconst atLeastNode = require('at-least-node')\n\nconst useNativeRecursiveOption = atLeastNode('10.12.0')\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nconst checkPath = pth => {\n if (process.platform === 'win32') {\n const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''))\n\n if (pathHasInvalidWinCharacters) {\n const error = new Error(`Path contains invalid characters: ${pth}`)\n error.code = 'EINVAL'\n throw error\n }\n }\n}\n\nconst processOptions = options => {\n const defaults = { mode: 0o777 }\n if (typeof options === 'number') options = { mode: options }\n return { ...defaults, ...options }\n}\n\nconst permissionError = pth => {\n // This replicates the exception of `fs.mkdir` with native the\n // `recusive` option when run on an invalid drive under Windows.\n const error = new Error(`operation not permitted, mkdir '${pth}'`)\n error.code = 'EPERM'\n error.errno = -4048\n error.path = pth\n error.syscall = 'mkdir'\n return error\n}\n\nmodule.exports.makeDir = async (input, options) => {\n checkPath(input)\n options = processOptions(options)\n\n if (useNativeRecursiveOption) {\n const pth = path.resolve(input)\n\n return fs.mkdir(pth, {\n mode: options.mode,\n recursive: true\n })\n }\n\n const make = async pth => {\n try {\n await fs.mkdir(pth, options.mode)\n } catch (error) {\n if (error.code === 'EPERM') {\n throw error\n }\n\n if (error.code === 'ENOENT') {\n if (path.dirname(pth) === pth) {\n throw permissionError(pth)\n }\n\n if (error.message.includes('null bytes')) {\n throw error\n }\n\n await make(path.dirname(pth))\n return make(pth)\n }\n\n try {\n const stats = await fs.stat(pth)\n if (!stats.isDirectory()) {\n // This error is never exposed to the user\n // it is caught below, and the original error is thrown\n throw new Error('The path is not a directory')\n }\n } catch {\n throw error\n }\n }\n }\n\n return make(path.resolve(input))\n}\n\nmodule.exports.makeDirSync = (input, options) => {\n checkPath(input)\n options = processOptions(options)\n\n if (useNativeRecursiveOption) {\n const pth = path.resolve(input)\n\n return fs.mkdirSync(pth, {\n mode: options.mode,\n recursive: true\n })\n }\n\n const make = pth => {\n try {\n fs.mkdirSync(pth, options.mode)\n } catch (error) {\n if (error.code === 'EPERM') {\n throw error\n }\n\n if (error.code === 'ENOENT') {\n if (path.dirname(pth) === pth) {\n throw permissionError(pth)\n }\n\n if (error.message.includes('null bytes')) {\n throw error\n }\n\n make(path.dirname(pth))\n return make(pth)\n }\n\n try {\n if (!fs.statSync(pth).isDirectory()) {\n // This error is never exposed to the user\n // it is caught below, and the original error is thrown\n throw new Error('The path is not a directory')\n }\n } catch {\n throw error\n }\n }\n }\n\n return make(path.resolve(input))\n}\n","'use strict'\n\nmodule.exports = {\n moveSync: require('./move-sync')\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copySync = require('../copy-sync').copySync\nconst removeSync = require('../remove').removeSync\nconst mkdirpSync = require('../mkdirs').mkdirpSync\nconst stat = require('../util/stat')\n\nfunction moveSync (src, dest, opts) {\n opts = opts || {}\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat } = stat.checkPathsSync(src, dest, 'move')\n stat.checkParentPathsSync(src, srcStat, dest, 'move')\n mkdirpSync(path.dirname(dest))\n return doRename(src, dest, overwrite)\n}\n\nfunction doRename (src, dest, overwrite) {\n if (overwrite) {\n removeSync(dest)\n return rename(src, dest, overwrite)\n }\n if (fs.existsSync(dest)) throw new Error('dest already exists.')\n return rename(src, dest, overwrite)\n}\n\nfunction rename (src, dest, overwrite) {\n try {\n fs.renameSync(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') throw err\n return moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nfunction moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copySync(src, dest, opts)\n return removeSync(src)\n}\n\nmodule.exports = moveSync\n","'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n move: u(require('./move'))\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copy = require('../copy').copy\nconst remove = require('../remove').remove\nconst mkdirp = require('../mkdirs').mkdirp\nconst pathExists = require('../path-exists').pathExists\nconst stat = require('../util/stat')\n\nfunction move (src, dest, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n\n const overwrite = opts.overwrite || opts.clobber || false\n\n stat.checkPaths(src, dest, 'move', (err, stats) => {\n if (err) return cb(err)\n const { srcStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'move', err => {\n if (err) return cb(err)\n mkdirp(path.dirname(dest), err => {\n if (err) return cb(err)\n return doRename(src, dest, overwrite, cb)\n })\n })\n })\n}\n\nfunction doRename (src, dest, overwrite, cb) {\n if (overwrite) {\n return remove(dest, err => {\n if (err) return cb(err)\n return rename(src, dest, overwrite, cb)\n })\n }\n pathExists(dest, (err, destExists) => {\n if (err) return cb(err)\n if (destExists) return cb(new Error('dest already exists.'))\n return rename(src, dest, overwrite, cb)\n })\n}\n\nfunction rename (src, dest, overwrite, cb) {\n fs.rename(src, dest, err => {\n if (!err) return cb()\n if (err.code !== 'EXDEV') return cb(err)\n return moveAcrossDevice(src, dest, overwrite, cb)\n })\n}\n\nfunction moveAcrossDevice (src, dest, overwrite, cb) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copy(src, dest, opts, err => {\n if (err) return cb(err)\n return remove(src, cb)\n })\n}\n\nmodule.exports = move\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction outputFile (file, data, encoding, callback) {\n if (typeof encoding === 'function') {\n callback = encoding\n encoding = 'utf8'\n }\n\n const dir = path.dirname(file)\n pathExists(dir, (err, itDoes) => {\n if (err) return callback(err)\n if (itDoes) return fs.writeFile(file, data, encoding, callback)\n\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n\n fs.writeFile(file, data, encoding, callback)\n })\n })\n}\n\nfunction outputFileSync (file, ...args) {\n const dir = path.dirname(file)\n if (fs.existsSync(dir)) {\n return fs.writeFileSync(file, ...args)\n }\n mkdir.mkdirsSync(dir)\n fs.writeFileSync(file, ...args)\n}\n\nmodule.exports = {\n outputFile: u(outputFile),\n outputFileSync\n}\n","'use strict'\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\n\nfunction pathExists (path) {\n return fs.access(path).then(() => true).catch(() => false)\n}\n\nmodule.exports = {\n pathExists: u(pathExists),\n pathExistsSync: fs.existsSync\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst rimraf = require('./rimraf')\n\nmodule.exports = {\n remove: u(rimraf),\n removeSync: rimraf.sync\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst assert = require('assert')\n\nconst isWindows = (process.platform === 'win32')\n\nfunction defaults (options) {\n const methods = [\n 'unlink',\n 'chmod',\n 'stat',\n 'lstat',\n 'rmdir',\n 'readdir'\n ]\n methods.forEach(m => {\n options[m] = options[m] || fs[m]\n m = m + 'Sync'\n options[m] = options[m] || fs[m]\n })\n\n options.maxBusyTries = options.maxBusyTries || 3\n}\n\nfunction rimraf (p, options, cb) {\n let busyTries = 0\n\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required')\n assert(options, 'rimraf: invalid options argument provided')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n defaults(options)\n\n rimraf_(p, options, function CB (er) {\n if (er) {\n if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') &&\n busyTries < options.maxBusyTries) {\n busyTries++\n const time = busyTries * 100\n // try again, with the same exact callback as this one.\n return setTimeout(() => rimraf_(p, options, CB), time)\n }\n\n // already gone\n if (er.code === 'ENOENT') er = null\n }\n\n cb(er)\n })\n}\n\n// Two possible strategies.\n// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR\n// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR\n//\n// Both result in an extra syscall when you guess wrong. However, there\n// are likely far more normal files in the world than directories. This\n// is based on the assumption that a the average number of files per\n// directory is >= 1.\n//\n// If anyone ever complains about this, then I guess the strategy could\n// be made configurable somehow. But until then, YAGNI.\nfunction rimraf_ (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // sunos lets the root user unlink directories, which is... weird.\n // so we have to lstat here and make sure it's not a dir.\n options.lstat(p, (er, st) => {\n if (er && er.code === 'ENOENT') {\n return cb(null)\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er && er.code === 'EPERM' && isWindows) {\n return fixWinEPERM(p, options, er, cb)\n }\n\n if (st && st.isDirectory()) {\n return rmdir(p, options, er, cb)\n }\n\n options.unlink(p, er => {\n if (er) {\n if (er.code === 'ENOENT') {\n return cb(null)\n }\n if (er.code === 'EPERM') {\n return (isWindows)\n ? fixWinEPERM(p, options, er, cb)\n : rmdir(p, options, er, cb)\n }\n if (er.code === 'EISDIR') {\n return rmdir(p, options, er, cb)\n }\n }\n return cb(er)\n })\n })\n}\n\nfunction fixWinEPERM (p, options, er, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.chmod(p, 0o666, er2 => {\n if (er2) {\n cb(er2.code === 'ENOENT' ? null : er)\n } else {\n options.stat(p, (er3, stats) => {\n if (er3) {\n cb(er3.code === 'ENOENT' ? null : er)\n } else if (stats.isDirectory()) {\n rmdir(p, options, er, cb)\n } else {\n options.unlink(p, cb)\n }\n })\n }\n })\n}\n\nfunction fixWinEPERMSync (p, options, er) {\n let stats\n\n assert(p)\n assert(options)\n\n try {\n options.chmodSync(p, 0o666)\n } catch (er2) {\n if (er2.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n try {\n stats = options.statSync(p)\n } catch (er3) {\n if (er3.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n if (stats.isDirectory()) {\n rmdirSync(p, options, er)\n } else {\n options.unlinkSync(p)\n }\n}\n\nfunction rmdir (p, options, originalEr, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)\n // if we guessed wrong, and it's not a directory, then\n // raise the original error.\n options.rmdir(p, er => {\n if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {\n rmkids(p, options, cb)\n } else if (er && er.code === 'ENOTDIR') {\n cb(originalEr)\n } else {\n cb(er)\n }\n })\n}\n\nfunction rmkids (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.readdir(p, (er, files) => {\n if (er) return cb(er)\n\n let n = files.length\n let errState\n\n if (n === 0) return options.rmdir(p, cb)\n\n files.forEach(f => {\n rimraf(path.join(p, f), options, er => {\n if (errState) {\n return\n }\n if (er) return cb(errState = er)\n if (--n === 0) {\n options.rmdir(p, cb)\n }\n })\n })\n })\n}\n\n// this looks simpler, and is strictly *faster*, but will\n// tie up the JavaScript thread and fail on excessively\n// deep directory trees.\nfunction rimrafSync (p, options) {\n let st\n\n options = options || {}\n defaults(options)\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert(options, 'rimraf: missing options')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n try {\n st = options.lstatSync(p)\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er.code === 'EPERM' && isWindows) {\n fixWinEPERMSync(p, options, er)\n }\n }\n\n try {\n // sunos lets the root user unlink directories, which is... weird.\n if (st && st.isDirectory()) {\n rmdirSync(p, options, null)\n } else {\n options.unlinkSync(p)\n }\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n } else if (er.code === 'EPERM') {\n return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)\n } else if (er.code !== 'EISDIR') {\n throw er\n }\n rmdirSync(p, options, er)\n }\n}\n\nfunction rmdirSync (p, options, originalEr) {\n assert(p)\n assert(options)\n\n try {\n options.rmdirSync(p)\n } catch (er) {\n if (er.code === 'ENOTDIR') {\n throw originalEr\n } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') {\n rmkidsSync(p, options)\n } else if (er.code !== 'ENOENT') {\n throw er\n }\n }\n}\n\nfunction rmkidsSync (p, options) {\n assert(p)\n assert(options)\n options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))\n\n if (isWindows) {\n // We only end up here once we got ENOTEMPTY at least once, and\n // at this point, we are guaranteed to have removed all the kids.\n // So, we know that it won't be ENOENT or ENOTDIR or anything else.\n // try really hard to delete stuff on windows, because it has a\n // PROFOUNDLY annoying habit of not closing handles promptly when\n // files are deleted, resulting in spurious ENOTEMPTY errors.\n const startTime = Date.now()\n do {\n try {\n const ret = options.rmdirSync(p, options)\n return ret\n } catch {}\n } while (Date.now() - startTime < 500) // give up after 500ms\n } else {\n const ret = options.rmdirSync(p, options)\n return ret\n }\n}\n\nmodule.exports = rimraf\nrimraf.sync = rimrafSync\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst util = require('util')\nconst atLeastNode = require('at-least-node')\n\nconst nodeSupportsBigInt = atLeastNode('10.5.0')\nconst stat = (file) => nodeSupportsBigInt ? fs.stat(file, { bigint: true }) : fs.stat(file)\nconst statSync = (file) => nodeSupportsBigInt ? fs.statSync(file, { bigint: true }) : fs.statSync(file)\n\nfunction getStats (src, dest) {\n return Promise.all([\n stat(src),\n stat(dest).catch(err => {\n if (err.code === 'ENOENT') return null\n throw err\n })\n ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))\n}\n\nfunction getStatsSync (src, dest) {\n let destStat\n const srcStat = statSync(src)\n try {\n destStat = statSync(dest)\n } catch (err) {\n if (err.code === 'ENOENT') return { srcStat, destStat: null }\n throw err\n }\n return { srcStat, destStat }\n}\n\nfunction checkPaths (src, dest, funcName, cb) {\n util.callbackify(getStats)(src, dest, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n if (destStat && areIdentical(srcStat, destStat)) {\n return cb(new Error('Source and destination must not be the same.'))\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return cb(null, { srcStat, destStat })\n })\n}\n\nfunction checkPathsSync (src, dest, funcName) {\n const { srcStat, destStat } = getStatsSync(src, dest)\n if (destStat && areIdentical(srcStat, destStat)) {\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return { srcStat, destStat }\n}\n\n// recursively check if dest parent is a subdirectory of src.\n// It works for all file types including symlinks since it\n// checks the src and dest inodes. It starts from the deepest\n// parent and stops once it reaches the src parent or the root path.\nfunction checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n const callback = (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (areIdentical(srcStat, destStat)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n }\n if (nodeSupportsBigInt) fs.stat(destParent, { bigint: true }, callback)\n else fs.stat(destParent, callback)\n}\n\nfunction checkParentPathsSync (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n let destStat\n try {\n destStat = statSync(destParent)\n } catch (err) {\n if (err.code === 'ENOENT') return\n throw err\n }\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return checkParentPathsSync(src, srcStat, destParent, funcName)\n}\n\nfunction areIdentical (srcStat, destStat) {\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n if (nodeSupportsBigInt || destStat.ino < Number.MAX_SAFE_INTEGER) {\n // definitive answer\n return true\n }\n // Use additional heuristics if we can't use 'bigint'.\n // Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER\n // See issue 657\n if (destStat.size === srcStat.size &&\n destStat.mode === srcStat.mode &&\n destStat.nlink === srcStat.nlink &&\n destStat.atimeMs === srcStat.atimeMs &&\n destStat.mtimeMs === srcStat.mtimeMs &&\n destStat.ctimeMs === srcStat.ctimeMs &&\n destStat.birthtimeMs === srcStat.birthtimeMs) {\n // heuristic answer\n return true\n }\n }\n return false\n}\n\n// return true if dest is a subdir of src, otherwise false.\n// It only checks the path strings.\nfunction isSrcSubdir (src, dest) {\n const srcArr = path.resolve(src).split(path.sep).filter(i => i)\n const destArr = path.resolve(dest).split(path.sep).filter(i => i)\n return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true)\n}\n\nfunction errMsg (src, dest, funcName) {\n return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`\n}\n\nmodule.exports = {\n checkPaths,\n checkPathsSync,\n checkParentPaths,\n checkParentPathsSync,\n isSrcSubdir\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction utimesMillis (path, atime, mtime, callback) {\n // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)\n fs.open(path, 'r+', (err, fd) => {\n if (err) return callback(err)\n fs.futimes(fd, atime, mtime, futimesErr => {\n fs.close(fd, closeErr => {\n if (callback) callback(futimesErr || closeErr)\n })\n })\n })\n}\n\nfunction utimesMillisSync (path, atime, mtime) {\n const fd = fs.openSync(path, 'r+')\n fs.futimesSync(fd, atime, mtime)\n return fs.closeSync(fd)\n}\n\nmodule.exports = {\n utimesMillis,\n utimesMillisSync\n}\n","'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n fn.call(\n this,\n ...args,\n (err, res) => (err != null) ? reject(err) : resolve(res)\n )\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)\n }, 'name', { value: fn.name })\n}\n","'use strict'\nconst MiniPass = require('minipass')\nconst EE = require('events').EventEmitter\nconst fs = require('fs')\n\nlet writev = fs.writev\n/* istanbul ignore next */\nif (!writev) {\n // This entire block can be removed if support for earlier than Node.js\n // 12.9.0 is not needed.\n const binding = process.binding('fs')\n const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback\n\n writev = (fd, iovec, pos, cb) => {\n const done = (er, bw) => cb(er, bw, iovec)\n const req = new FSReqWrap()\n req.oncomplete = done\n binding.writeBuffers(fd, iovec, pos, req)\n }\n}\n\nconst _autoClose = Symbol('_autoClose')\nconst _close = Symbol('_close')\nconst _ended = Symbol('_ended')\nconst _fd = Symbol('_fd')\nconst _finished = Symbol('_finished')\nconst _flags = Symbol('_flags')\nconst _flush = Symbol('_flush')\nconst _handleChunk = Symbol('_handleChunk')\nconst _makeBuf = Symbol('_makeBuf')\nconst _mode = Symbol('_mode')\nconst _needDrain = Symbol('_needDrain')\nconst _onerror = Symbol('_onerror')\nconst _onopen = Symbol('_onopen')\nconst _onread = Symbol('_onread')\nconst _onwrite = Symbol('_onwrite')\nconst _open = Symbol('_open')\nconst _path = Symbol('_path')\nconst _pos = Symbol('_pos')\nconst _queue = Symbol('_queue')\nconst _read = Symbol('_read')\nconst _readSize = Symbol('_readSize')\nconst _reading = Symbol('_reading')\nconst _remain = Symbol('_remain')\nconst _size = Symbol('_size')\nconst _write = Symbol('_write')\nconst _writing = Symbol('_writing')\nconst _defaultFlag = Symbol('_defaultFlag')\nconst _errored = Symbol('_errored')\n\nclass ReadStream extends MiniPass {\n constructor (path, opt) {\n opt = opt || {}\n super(opt)\n\n this.readable = true\n this.writable = false\n\n if (typeof path !== 'string')\n throw new TypeError('path must be a string')\n\n this[_errored] = false\n this[_fd] = typeof opt.fd === 'number' ? opt.fd : null\n this[_path] = path\n this[_readSize] = opt.readSize || 16*1024*1024\n this[_reading] = false\n this[_size] = typeof opt.size === 'number' ? opt.size : Infinity\n this[_remain] = this[_size]\n this[_autoClose] = typeof opt.autoClose === 'boolean' ?\n opt.autoClose : true\n\n if (typeof this[_fd] === 'number')\n this[_read]()\n else\n this[_open]()\n }\n\n get fd () { return this[_fd] }\n get path () { return this[_path] }\n\n write () {\n throw new TypeError('this is a readable stream')\n }\n\n end () {\n throw new TypeError('this is a readable stream')\n }\n\n [_open] () {\n fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd))\n }\n\n [_onopen] (er, fd) {\n if (er)\n this[_onerror](er)\n else {\n this[_fd] = fd\n this.emit('open', fd)\n this[_read]()\n }\n }\n\n [_makeBuf] () {\n return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]))\n }\n\n [_read] () {\n if (!this[_reading]) {\n this[_reading] = true\n const buf = this[_makeBuf]()\n /* istanbul ignore if */\n if (buf.length === 0)\n return process.nextTick(() => this[_onread](null, 0, buf))\n fs.read(this[_fd], buf, 0, buf.length, null, (er, br, buf) =>\n this[_onread](er, br, buf))\n }\n }\n\n [_onread] (er, br, buf) {\n this[_reading] = false\n if (er)\n this[_onerror](er)\n else if (this[_handleChunk](br, buf))\n this[_read]()\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'))\n }\n }\n\n [_onerror] (er) {\n this[_reading] = true\n this[_close]()\n this.emit('error', er)\n }\n\n [_handleChunk] (br, buf) {\n let ret = false\n // no effect if infinite\n this[_remain] -= br\n if (br > 0)\n ret = super.write(br < buf.length ? buf.slice(0, br) : buf)\n\n if (br === 0 || this[_remain] <= 0) {\n ret = false\n this[_close]()\n super.end()\n }\n\n return ret\n }\n\n emit (ev, data) {\n switch (ev) {\n case 'prefinish':\n case 'finish':\n break\n\n case 'drain':\n if (typeof this[_fd] === 'number')\n this[_read]()\n break\n\n case 'error':\n if (this[_errored])\n return\n this[_errored] = true\n return super.emit(ev, data)\n\n default:\n return super.emit(ev, data)\n }\n }\n}\n\nclass ReadStreamSync extends ReadStream {\n [_open] () {\n let threw = true\n try {\n this[_onopen](null, fs.openSync(this[_path], 'r'))\n threw = false\n } finally {\n if (threw)\n this[_close]()\n }\n }\n\n [_read] () {\n let threw = true\n try {\n if (!this[_reading]) {\n this[_reading] = true\n do {\n const buf = this[_makeBuf]()\n /* istanbul ignore next */\n const br = buf.length === 0 ? 0\n : fs.readSync(this[_fd], buf, 0, buf.length, null)\n if (!this[_handleChunk](br, buf))\n break\n } while (true)\n this[_reading] = false\n }\n threw = false\n } finally {\n if (threw)\n this[_close]()\n }\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.closeSync(fd)\n this.emit('close')\n }\n }\n}\n\nclass WriteStream extends EE {\n constructor (path, opt) {\n opt = opt || {}\n super(opt)\n this.readable = false\n this.writable = true\n this[_errored] = false\n this[_writing] = false\n this[_ended] = false\n this[_needDrain] = false\n this[_queue] = []\n this[_path] = path\n this[_fd] = typeof opt.fd === 'number' ? opt.fd : null\n this[_mode] = opt.mode === undefined ? 0o666 : opt.mode\n this[_pos] = typeof opt.start === 'number' ? opt.start : null\n this[_autoClose] = typeof opt.autoClose === 'boolean' ?\n opt.autoClose : true\n\n // truncating makes no sense when writing into the middle\n const defaultFlag = this[_pos] !== null ? 'r+' : 'w'\n this[_defaultFlag] = opt.flags === undefined\n this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags\n\n if (this[_fd] === null)\n this[_open]()\n }\n\n emit (ev, data) {\n if (ev === 'error') {\n if (this[_errored])\n return\n this[_errored] = true\n }\n return super.emit(ev, data)\n }\n\n\n get fd () { return this[_fd] }\n get path () { return this[_path] }\n\n [_onerror] (er) {\n this[_close]()\n this[_writing] = true\n this.emit('error', er)\n }\n\n [_open] () {\n fs.open(this[_path], this[_flags], this[_mode],\n (er, fd) => this[_onopen](er, fd))\n }\n\n [_onopen] (er, fd) {\n if (this[_defaultFlag] &&\n this[_flags] === 'r+' &&\n er && er.code === 'ENOENT') {\n this[_flags] = 'w'\n this[_open]()\n } else if (er)\n this[_onerror](er)\n else {\n this[_fd] = fd\n this.emit('open', fd)\n this[_flush]()\n }\n }\n\n end (buf, enc) {\n if (buf)\n this.write(buf, enc)\n\n this[_ended] = true\n\n // synthetic after-write logic, where drain/finish live\n if (!this[_writing] && !this[_queue].length &&\n typeof this[_fd] === 'number')\n this[_onwrite](null, 0)\n return this\n }\n\n write (buf, enc) {\n if (typeof buf === 'string')\n buf = Buffer.from(buf, enc)\n\n if (this[_ended]) {\n this.emit('error', new Error('write() after end()'))\n return false\n }\n\n if (this[_fd] === null || this[_writing] || this[_queue].length) {\n this[_queue].push(buf)\n this[_needDrain] = true\n return false\n }\n\n this[_writing] = true\n this[_write](buf)\n return true\n }\n\n [_write] (buf) {\n fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) =>\n this[_onwrite](er, bw))\n }\n\n [_onwrite] (er, bw) {\n if (er)\n this[_onerror](er)\n else {\n if (this[_pos] !== null)\n this[_pos] += bw\n if (this[_queue].length)\n this[_flush]()\n else {\n this[_writing] = false\n\n if (this[_ended] && !this[_finished]) {\n this[_finished] = true\n this[_close]()\n this.emit('finish')\n } else if (this[_needDrain]) {\n this[_needDrain] = false\n this.emit('drain')\n }\n }\n }\n }\n\n [_flush] () {\n if (this[_queue].length === 0) {\n if (this[_ended])\n this[_onwrite](null, 0)\n } else if (this[_queue].length === 1)\n this[_write](this[_queue].pop())\n else {\n const iovec = this[_queue]\n this[_queue] = []\n writev(this[_fd], iovec, this[_pos],\n (er, bw) => this[_onwrite](er, bw))\n }\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'))\n }\n }\n}\n\nclass WriteStreamSync extends WriteStream {\n [_open] () {\n let fd\n // only wrap in a try{} block if we know we'll retry, to avoid\n // the rethrow obscuring the error's source frame in most cases.\n if (this[_defaultFlag] && this[_flags] === 'r+') {\n try {\n fd = fs.openSync(this[_path], this[_flags], this[_mode])\n } catch (er) {\n if (er.code === 'ENOENT') {\n this[_flags] = 'w'\n return this[_open]()\n } else\n throw er\n }\n } else\n fd = fs.openSync(this[_path], this[_flags], this[_mode])\n\n this[_onopen](null, fd)\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.closeSync(fd)\n this.emit('close')\n }\n }\n\n [_write] (buf) {\n // throw the original, but try to close if it fails\n let threw = true\n try {\n this[_onwrite](null,\n fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos]))\n threw = false\n } finally {\n if (threw)\n try { this[_close]() } catch (_) {}\n }\n }\n}\n\nexports.ReadStream = ReadStream\nexports.ReadStreamSync = ReadStreamSync\n\nexports.WriteStream = WriteStream\nexports.WriteStreamSync = WriteStreamSync\n","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n retry()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n retry()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([fs$copyFile, [src, dest, flags, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n function readdir (path, options, cb) {\n var args = [path]\n if (typeof options !== 'function') {\n args.push(options)\n } else {\n cb = options\n }\n args.push(go$readdir$cb)\n\n return go$readdir(args)\n\n function go$readdir$cb (err, files) {\n if (files && files.sort)\n files.sort()\n\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readdir, [args]])\n\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n }\n }\n\n function go$readdir (args) {\n return fs$readdir.apply(fs, args)\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n}\n\nfunction retry () {\n var elem = fs[gracefulQueue].shift()\n if (elem) {\n debug('RETRY', elem[0].name, elem[1])\n elem[0].apply(null, elem[1])\n }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (!fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (!fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = (function (fs$rename) { return function (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }})(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\")) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","let _fs\ntry {\n _fs = require('graceful-fs')\n} catch (_) {\n _fs = require('fs')\n}\nconst universalify = require('universalify')\nconst { stringify, stripBom } = require('./utils')\n\nasync function _readFile (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n let data = await universalify.fromCallback(fs.readFile)(file, options)\n\n data = stripBom(data)\n\n let obj\n try {\n obj = JSON.parse(data, options ? options.reviver : null)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n\n return obj\n}\n\nconst readFile = universalify.fromPromise(_readFile)\n\nfunction readFileSync (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n try {\n let content = fs.readFileSync(file, options)\n content = stripBom(content)\n return JSON.parse(content, options.reviver)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n}\n\nasync function _writeFile (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n\n await universalify.fromCallback(fs.writeFile)(file, str, options)\n}\n\nconst writeFile = universalify.fromPromise(_writeFile)\n\nfunction writeFileSync (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n // not sure if fs.writeFileSync returns anything, but just in case\n return fs.writeFileSync(file, str, options)\n}\n\nconst jsonfile = {\n readFile,\n readFileSync,\n writeFile,\n writeFileSync\n}\n\nmodule.exports = jsonfile\n","'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n fn.call(\n this,\n ...args,\n (err, res) => (err != null) ? reject(err) : resolve(res)\n )\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)\n }, 'name', { value: fn.name })\n}\n","function stringify (obj, { EOL = '\\n', finalEOL = true, replacer = null, spaces } = {}) {\n const EOF = finalEOL ? EOL : ''\n const str = JSON.stringify(obj, replacer, spaces)\n\n return str.replace(/\\n/g, EOL) + EOF\n}\n\nfunction stripBom (content) {\n // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n if (Buffer.isBuffer(content)) content = content.toString('utf8')\n return content.replace(/^\\uFEFF/, '')\n}\n\nmodule.exports = { stringify, stripBom }\n","'use strict';\n\nvar helpers = require('./helpers');\n\n/** @type ValidatorResult */\nvar ValidatorResult = helpers.ValidatorResult;\n/** @type SchemaError */\nvar SchemaError = helpers.SchemaError;\n\nvar attribute = {};\n\nattribute.ignoreProperties = {\n // informative properties\n 'id': true,\n 'default': true,\n 'description': true,\n 'title': true,\n // arguments to other properties\n 'additionalItems': true,\n 'then': true,\n 'else': true,\n // special-handled properties\n '$schema': true,\n '$ref': true,\n 'extends': true,\n};\n\n/**\n * @name validators\n */\nvar validators = attribute.validators = {};\n\n/**\n * Validates whether the instance if of a certain type\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {ValidatorResult|null}\n */\nvalidators.type = function validateType (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) {\n return null;\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n var types = Array.isArray(schema.type) ? schema.type : [schema.type];\n if (!types.some(this.testType.bind(this, instance, schema, options, ctx))) {\n var list = types.map(function (v) {\n if(!v) return;\n var id = v.$id || v.id;\n return id ? ('<' + id + '>') : (v+'');\n });\n result.addError({\n name: 'type',\n argument: list,\n message: \"is not of a type(s) \" + list,\n });\n }\n return result;\n};\n\nfunction testSchemaNoThrow(instance, options, ctx, callback, schema){\n var throwError = options.throwError;\n var throwAll = options.throwAll;\n options.throwError = false;\n options.throwAll = false;\n var res = this.validateSchema(instance, schema, options, ctx);\n options.throwError = throwError;\n options.throwAll = throwAll;\n\n if (!res.valid && callback instanceof Function) {\n callback(res);\n }\n return res.valid;\n}\n\n/**\n * Validates whether the instance matches some of the given schemas\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {ValidatorResult|null}\n */\nvalidators.anyOf = function validateAnyOf (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) {\n return null;\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n var inner = new ValidatorResult(instance, schema, options, ctx);\n if (!Array.isArray(schema.anyOf)){\n throw new SchemaError(\"anyOf must be an array\");\n }\n if (!schema.anyOf.some(\n testSchemaNoThrow.bind(\n this, instance, options, ctx, function(res){inner.importErrors(res);}\n ))) {\n var list = schema.anyOf.map(function (v, i) {\n var id = v.$id || v.id;\n if(id) return '<' + id + '>';\n return(v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']';\n });\n if (options.nestedErrors) {\n result.importErrors(inner);\n }\n result.addError({\n name: 'anyOf',\n argument: list,\n message: \"is not any of \" + list.join(','),\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance matches every given schema\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null}\n */\nvalidators.allOf = function validateAllOf (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) {\n return null;\n }\n if (!Array.isArray(schema.allOf)){\n throw new SchemaError(\"allOf must be an array\");\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n var self = this;\n schema.allOf.forEach(function(v, i){\n var valid = self.validateSchema(instance, v, options, ctx);\n if(!valid.valid){\n var id = v.$id || v.id;\n var msg = id || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']';\n result.addError({\n name: 'allOf',\n argument: { id: msg, length: valid.errors.length, valid: valid },\n message: 'does not match allOf schema ' + msg + ' with ' + valid.errors.length + ' error[s]:',\n });\n result.importErrors(valid);\n }\n });\n return result;\n};\n\n/**\n * Validates whether the instance matches exactly one of the given schemas\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null}\n */\nvalidators.oneOf = function validateOneOf (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) {\n return null;\n }\n if (!Array.isArray(schema.oneOf)){\n throw new SchemaError(\"oneOf must be an array\");\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n var inner = new ValidatorResult(instance, schema, options, ctx);\n var count = schema.oneOf.filter(\n testSchemaNoThrow.bind(\n this, instance, options, ctx, function(res) {inner.importErrors(res);}\n ) ).length;\n var list = schema.oneOf.map(function (v, i) {\n var id = v.$id || v.id;\n return id || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']';\n });\n if (count!==1) {\n if (options.nestedErrors) {\n result.importErrors(inner);\n }\n result.addError({\n name: 'oneOf',\n argument: list,\n message: \"is not exactly one from \" + list.join(','),\n });\n }\n return result;\n};\n\n/**\n * Validates \"then\" or \"else\" depending on the result of validating \"if\"\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null}\n */\nvalidators.if = function validateIf (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) return null;\n if (!helpers.isSchema(schema.if)) throw new Error('Expected \"if\" keyword to be a schema');\n var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema.if);\n var result = new ValidatorResult(instance, schema, options, ctx);\n var res;\n if(ifValid){\n if (schema.then === undefined) return;\n if (!helpers.isSchema(schema.then)) throw new Error('Expected \"then\" keyword to be a schema');\n res = this.validateSchema(instance, schema.then, options, ctx.makeChild(schema.then));\n result.importErrors(res);\n }else{\n if (schema.else === undefined) return;\n if (!helpers.isSchema(schema.else)) throw new Error('Expected \"else\" keyword to be a schema');\n res = this.validateSchema(instance, schema.else, options, ctx.makeChild(schema.else));\n result.importErrors(res);\n }\n return result;\n};\n\nfunction getEnumerableProperty(object, key){\n // Determine if `key` shows up in `for(var key in object)`\n // First test Object.hasOwnProperty.call as an optimization: that guarantees it does\n if(Object.hasOwnProperty.call(object, key)) return object[key];\n // Test `key in object` as an optimization; false means it won't\n if(!(key in object)) return;\n while( (object = Object.getPrototypeOf(object)) ){\n if(Object.propertyIsEnumerable.call(object, key)) return object[key];\n }\n}\n\n/**\n * Validates propertyNames\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.propertyNames = function validatePropertyNames (instance, schema, options, ctx) {\n if(!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var subschema = schema.propertyNames!==undefined ? schema.propertyNames : {};\n if(!helpers.isSchema(subschema)) throw new SchemaError('Expected \"propertyNames\" to be a schema (object or boolean)');\n\n for (var property in instance) {\n if(getEnumerableProperty(instance, property) !== undefined){\n var res = this.validateSchema(property, subschema, options, ctx.makeChild(subschema));\n result.importErrors(res);\n }\n }\n\n return result;\n};\n\n/**\n * Validates properties\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.properties = function validateProperties (instance, schema, options, ctx) {\n if(!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var properties = schema.properties || {};\n for (var property in properties) {\n var subschema = properties[property];\n if(subschema===undefined){\n continue;\n }else if(subschema===null){\n throw new SchemaError('Unexpected null, expected schema in \"properties\"');\n }\n if (typeof options.preValidateProperty == 'function') {\n options.preValidateProperty(instance, property, subschema, options, ctx);\n }\n var prop = getEnumerableProperty(instance, property);\n var res = this.validateSchema(prop, subschema, options, ctx.makeChild(subschema, property));\n if(res.instance !== result.instance[property]) result.instance[property] = res.instance;\n result.importErrors(res);\n }\n return result;\n};\n\n/**\n * Test a specific property within in instance against the additionalProperties schema attribute\n * This ignores properties with definitions in the properties schema attribute, but no other attributes.\n * If too many more types of property-existence tests pop up they may need their own class of tests (like `type` has)\n * @private\n * @return {boolean}\n */\nfunction testAdditionalProperty (instance, schema, options, ctx, property, result) {\n if(!this.types.object(instance)) return;\n if (schema.properties && schema.properties[property] !== undefined) {\n return;\n }\n if (schema.additionalProperties === false) {\n result.addError({\n name: 'additionalProperties',\n argument: property,\n message: \"is not allowed to have the additional property \" + JSON.stringify(property),\n });\n } else {\n var additionalProperties = schema.additionalProperties || {};\n\n if (typeof options.preValidateProperty == 'function') {\n options.preValidateProperty(instance, property, additionalProperties, options, ctx);\n }\n\n var res = this.validateSchema(instance[property], additionalProperties, options, ctx.makeChild(additionalProperties, property));\n if(res.instance !== result.instance[property]) result.instance[property] = res.instance;\n result.importErrors(res);\n }\n}\n\n/**\n * Validates patternProperties\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.patternProperties = function validatePatternProperties (instance, schema, options, ctx) {\n if(!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var patternProperties = schema.patternProperties || {};\n\n for (var property in instance) {\n var test = true;\n for (var pattern in patternProperties) {\n var subschema = patternProperties[pattern];\n if(subschema===undefined){\n continue;\n }else if(subschema===null){\n throw new SchemaError('Unexpected null, expected schema in \"patternProperties\"');\n }\n try {\n var regexp = new RegExp(pattern, 'u');\n } catch(_e) {\n // In the event the stricter handling causes an error, fall back on the forgiving handling\n // DEPRECATED\n regexp = new RegExp(pattern);\n }\n if (!regexp.test(property)) {\n continue;\n }\n test = false;\n\n if (typeof options.preValidateProperty == 'function') {\n options.preValidateProperty(instance, property, subschema, options, ctx);\n }\n\n var res = this.validateSchema(instance[property], subschema, options, ctx.makeChild(subschema, property));\n if(res.instance !== result.instance[property]) result.instance[property] = res.instance;\n result.importErrors(res);\n }\n if (test) {\n testAdditionalProperty.call(this, instance, schema, options, ctx, property, result);\n }\n }\n\n return result;\n};\n\n/**\n * Validates additionalProperties\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.additionalProperties = function validateAdditionalProperties (instance, schema, options, ctx) {\n if(!this.types.object(instance)) return;\n // if patternProperties is defined then we'll test when that one is called instead\n if (schema.patternProperties) {\n return null;\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n for (var property in instance) {\n testAdditionalProperty.call(this, instance, schema, options, ctx, property, result);\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is at least of a certain length, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.minProperties = function validateMinProperties (instance, schema, options, ctx) {\n if (!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var keys = Object.keys(instance);\n if (!(keys.length >= schema.minProperties)) {\n result.addError({\n name: 'minProperties',\n argument: schema.minProperties,\n message: \"does not meet minimum property length of \" + schema.minProperties,\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is at most of a certain length, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.maxProperties = function validateMaxProperties (instance, schema, options, ctx) {\n if (!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var keys = Object.keys(instance);\n if (!(keys.length <= schema.maxProperties)) {\n result.addError({\n name: 'maxProperties',\n argument: schema.maxProperties,\n message: \"does not meet maximum property length of \" + schema.maxProperties,\n });\n }\n return result;\n};\n\n/**\n * Validates items when instance is an array\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.items = function validateItems (instance, schema, options, ctx) {\n var self = this;\n if (!this.types.array(instance)) return;\n if (!schema.items) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n instance.every(function (value, i) {\n var items = Array.isArray(schema.items) ? (schema.items[i] || schema.additionalItems) : schema.items;\n if (items === undefined) {\n return true;\n }\n if (items === false) {\n result.addError({\n name: 'items',\n message: \"additionalItems not permitted\",\n });\n return false;\n }\n var res = self.validateSchema(value, items, options, ctx.makeChild(items, i));\n if(res.instance !== result.instance[i]) result.instance[i] = res.instance;\n result.importErrors(res);\n return true;\n });\n return result;\n};\n\n/**\n * Validates minimum and exclusiveMinimum when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.minimum = function validateMinimum (instance, schema, options, ctx) {\n if (!this.types.number(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (schema.exclusiveMinimum && schema.exclusiveMinimum === true) {\n if(!(instance > schema.minimum)){\n result.addError({\n name: 'minimum',\n argument: schema.minimum,\n message: \"must be greater than \" + schema.minimum,\n });\n }\n } else {\n if(!(instance >= schema.minimum)){\n result.addError({\n name: 'minimum',\n argument: schema.minimum,\n message: \"must be greater than or equal to \" + schema.minimum,\n });\n }\n }\n return result;\n};\n\n/**\n * Validates maximum and exclusiveMaximum when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.maximum = function validateMaximum (instance, schema, options, ctx) {\n if (!this.types.number(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (schema.exclusiveMaximum && schema.exclusiveMaximum === true) {\n if(!(instance < schema.maximum)){\n result.addError({\n name: 'maximum',\n argument: schema.maximum,\n message: \"must be less than \" + schema.maximum,\n });\n }\n } else {\n if(!(instance <= schema.maximum)){\n result.addError({\n name: 'maximum',\n argument: schema.maximum,\n message: \"must be less than or equal to \" + schema.maximum,\n });\n }\n }\n return result;\n};\n\n/**\n * Validates the number form of exclusiveMinimum when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.exclusiveMinimum = function validateExclusiveMinimum (instance, schema, options, ctx) {\n // Support the boolean form of exclusiveMinimum, which is handled by the \"minimum\" keyword.\n if(typeof schema.exclusiveMaximum === 'boolean') return;\n if (!this.types.number(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var valid = instance > schema.exclusiveMinimum;\n if (!valid) {\n result.addError({\n name: 'exclusiveMinimum',\n argument: schema.exclusiveMinimum,\n message: \"must be strictly greater than \" + schema.exclusiveMinimum,\n });\n }\n return result;\n};\n\n/**\n * Validates the number form of exclusiveMaximum when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.exclusiveMaximum = function validateExclusiveMaximum (instance, schema, options, ctx) {\n // Support the boolean form of exclusiveMaximum, which is handled by the \"maximum\" keyword.\n if(typeof schema.exclusiveMaximum === 'boolean') return;\n if (!this.types.number(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var valid = instance < schema.exclusiveMaximum;\n if (!valid) {\n result.addError({\n name: 'exclusiveMaximum',\n argument: schema.exclusiveMaximum,\n message: \"must be strictly less than \" + schema.exclusiveMaximum,\n });\n }\n return result;\n};\n\n/**\n * Perform validation for multipleOf and divisibleBy, which are essentially the same.\n * @param instance\n * @param schema\n * @param validationType\n * @param errorMessage\n * @returns {String|null}\n */\nvar validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy (instance, schema, options, ctx, validationType, errorMessage) {\n if (!this.types.number(instance)) return;\n\n var validationArgument = schema[validationType];\n if (validationArgument == 0) {\n throw new SchemaError(validationType + \" cannot be zero\");\n }\n\n var result = new ValidatorResult(instance, schema, options, ctx);\n\n var instanceDecimals = helpers.getDecimalPlaces(instance);\n var divisorDecimals = helpers.getDecimalPlaces(validationArgument);\n\n var maxDecimals = Math.max(instanceDecimals , divisorDecimals);\n var multiplier = Math.pow(10, maxDecimals);\n\n if (Math.round(instance * multiplier) % Math.round(validationArgument * multiplier) !== 0) {\n result.addError({\n name: validationType,\n argument: validationArgument,\n message: errorMessage + JSON.stringify(validationArgument),\n });\n }\n\n return result;\n};\n\n/**\n * Validates divisibleBy when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.multipleOf = function validateMultipleOf (instance, schema, options, ctx) {\n return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, \"multipleOf\", \"is not a multiple of (divisible by) \");\n};\n\n/**\n * Validates multipleOf when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.divisibleBy = function validateDivisibleBy (instance, schema, options, ctx) {\n return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, \"divisibleBy\", \"is not divisible by (multiple of) \");\n};\n\n/**\n * Validates whether the instance value is present.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.required = function validateRequired (instance, schema, options, ctx) {\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (instance === undefined && schema.required === true) {\n // A boolean form is implemented for reverse-compatibility with schemas written against older drafts\n result.addError({\n name: 'required',\n message: \"is required\",\n });\n } else if (this.types.object(instance) && Array.isArray(schema.required)) {\n schema.required.forEach(function(n){\n if(getEnumerableProperty(instance, n)===undefined){\n result.addError({\n name: 'required',\n argument: n,\n message: \"requires property \" + JSON.stringify(n),\n });\n }\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value matches the regular expression, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.pattern = function validatePattern (instance, schema, options, ctx) {\n if (!this.types.string(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var pattern = schema.pattern;\n try {\n var regexp = new RegExp(pattern, 'u');\n } catch(_e) {\n // In the event the stricter handling causes an error, fall back on the forgiving handling\n // DEPRECATED\n regexp = new RegExp(pattern);\n }\n if (!instance.match(regexp)) {\n result.addError({\n name: 'pattern',\n argument: schema.pattern,\n message: \"does not match pattern \" + JSON.stringify(schema.pattern.toString()),\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is of a certain defined format or a custom\n * format.\n * The following formats are supported for string types:\n * - date-time\n * - date\n * - time\n * - ip-address\n * - ipv6\n * - uri\n * - color\n * - host-name\n * - alpha\n * - alpha-numeric\n * - utc-millisec\n * @param instance\n * @param schema\n * @param [options]\n * @param [ctx]\n * @return {String|null}\n */\nvalidators.format = function validateFormat (instance, schema, options, ctx) {\n if (instance===undefined) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!result.disableFormat && !helpers.isFormat(instance, schema.format, this)) {\n result.addError({\n name: 'format',\n argument: schema.format,\n message: \"does not conform to the \" + JSON.stringify(schema.format) + \" format\",\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is at least of a certain length, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.minLength = function validateMinLength (instance, schema, options, ctx) {\n if (!this.types.string(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var hsp = instance.match(/[\\uDC00-\\uDFFF]/g);\n var length = instance.length - (hsp ? hsp.length : 0);\n if (!(length >= schema.minLength)) {\n result.addError({\n name: 'minLength',\n argument: schema.minLength,\n message: \"does not meet minimum length of \" + schema.minLength,\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is at most of a certain length, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.maxLength = function validateMaxLength (instance, schema, options, ctx) {\n if (!this.types.string(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n // TODO if this was already computed in \"minLength\", use that value instead of re-computing\n var hsp = instance.match(/[\\uDC00-\\uDFFF]/g);\n var length = instance.length - (hsp ? hsp.length : 0);\n if (!(length <= schema.maxLength)) {\n result.addError({\n name: 'maxLength',\n argument: schema.maxLength,\n message: \"does not meet maximum length of \" + schema.maxLength,\n });\n }\n return result;\n};\n\n/**\n * Validates whether instance contains at least a minimum number of items, when the instance is an Array.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.minItems = function validateMinItems (instance, schema, options, ctx) {\n if (!this.types.array(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!(instance.length >= schema.minItems)) {\n result.addError({\n name: 'minItems',\n argument: schema.minItems,\n message: \"does not meet minimum length of \" + schema.minItems,\n });\n }\n return result;\n};\n\n/**\n * Validates whether instance contains no more than a maximum number of items, when the instance is an Array.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.maxItems = function validateMaxItems (instance, schema, options, ctx) {\n if (!this.types.array(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!(instance.length <= schema.maxItems)) {\n result.addError({\n name: 'maxItems',\n argument: schema.maxItems,\n message: \"does not meet maximum length of \" + schema.maxItems,\n });\n }\n return result;\n};\n\n/**\n * Deep compares arrays for duplicates\n * @param v\n * @param i\n * @param a\n * @private\n * @return {boolean}\n */\nfunction testArrays (v, i, a) {\n var j, len = a.length;\n for (j = i + 1, len; j < len; j++) {\n if (helpers.deepCompareStrict(v, a[j])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Validates whether there are no duplicates, when the instance is an Array.\n * @param instance\n * @return {String|null}\n */\nvalidators.uniqueItems = function validateUniqueItems (instance, schema, options, ctx) {\n if (schema.uniqueItems!==true) return;\n if (!this.types.array(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!instance.every(testArrays)) {\n result.addError({\n name: 'uniqueItems',\n message: \"contains duplicate item\",\n });\n }\n return result;\n};\n\n/**\n * Validate for the presence of dependency properties, if the instance is an object.\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {null|ValidatorResult}\n */\nvalidators.dependencies = function validateDependencies (instance, schema, options, ctx) {\n if (!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n for (var property in schema.dependencies) {\n if (instance[property] === undefined) {\n continue;\n }\n var dep = schema.dependencies[property];\n var childContext = ctx.makeChild(dep, property);\n if (typeof dep == 'string') {\n dep = [dep];\n }\n if (Array.isArray(dep)) {\n dep.forEach(function (prop) {\n if (instance[prop] === undefined) {\n result.addError({\n // FIXME there's two different \"dependencies\" errors here with slightly different outputs\n // Can we make these the same? Or should we create different error types?\n name: 'dependencies',\n argument: childContext.propertyPath,\n message: \"property \" + prop + \" not found, required by \" + childContext.propertyPath,\n });\n }\n });\n } else {\n var res = this.validateSchema(instance, dep, options, childContext);\n if(result.instance !== res.instance) result.instance = res.instance;\n if (res && res.errors.length) {\n result.addError({\n name: 'dependencies',\n argument: childContext.propertyPath,\n message: \"does not meet dependency required by \" + childContext.propertyPath,\n });\n result.importErrors(res);\n }\n }\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is one of the enumerated values.\n *\n * @param instance\n * @param schema\n * @return {ValidatorResult|null}\n */\nvalidators['enum'] = function validateEnum (instance, schema, options, ctx) {\n if (instance === undefined) {\n return null;\n }\n if (!Array.isArray(schema['enum'])) {\n throw new SchemaError(\"enum expects an array\", schema);\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!schema['enum'].some(helpers.deepCompareStrict.bind(null, instance))) {\n result.addError({\n name: 'enum',\n argument: schema['enum'],\n message: \"is not one of enum values: \" + schema['enum'].map(String).join(','),\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance exactly matches a given value\n *\n * @param instance\n * @param schema\n * @return {ValidatorResult|null}\n */\nvalidators['const'] = function validateEnum (instance, schema, options, ctx) {\n if (instance === undefined) {\n return null;\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!helpers.deepCompareStrict(schema['const'], instance)) {\n result.addError({\n name: 'const',\n argument: schema['const'],\n message: \"does not exactly match expected constant: \" + schema['const'],\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance if of a prohibited type.\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {null|ValidatorResult}\n */\nvalidators.not = validators.disallow = function validateNot (instance, schema, options, ctx) {\n var self = this;\n if(instance===undefined) return null;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var notTypes = schema.not || schema.disallow;\n if(!notTypes) return null;\n if(!Array.isArray(notTypes)) notTypes=[notTypes];\n notTypes.forEach(function (type) {\n if (self.testType(instance, schema, options, ctx, type)) {\n var id = type && (type.$id || type.id);\n var schemaId = id || type;\n result.addError({\n name: 'not',\n argument: schemaId,\n message: \"is of prohibited type \" + schemaId,\n });\n }\n });\n return result;\n};\n\nmodule.exports = attribute;\n","'use strict';\n\nvar uri = require('url');\n\nvar ValidationError = exports.ValidationError = function ValidationError (message, instance, schema, path, name, argument) {\n if(Array.isArray(path)){\n this.path = path;\n this.property = path.reduce(function(sum, item){\n return sum + makeSuffix(item);\n }, 'instance');\n }else if(path !== undefined){\n this.property = path;\n }\n if (message) {\n this.message = message;\n }\n if (schema) {\n var id = schema.$id || schema.id;\n this.schema = id || schema;\n }\n if (instance !== undefined) {\n this.instance = instance;\n }\n this.name = name;\n this.argument = argument;\n this.stack = this.toString();\n};\n\nValidationError.prototype.toString = function toString() {\n return this.property + ' ' + this.message;\n};\n\nvar ValidatorResult = exports.ValidatorResult = function ValidatorResult(instance, schema, options, ctx) {\n this.instance = instance;\n this.schema = schema;\n this.options = options;\n this.path = ctx.path;\n this.propertyPath = ctx.propertyPath;\n this.errors = [];\n this.throwError = options && options.throwError;\n this.throwFirst = options && options.throwFirst;\n this.throwAll = options && options.throwAll;\n this.disableFormat = options && options.disableFormat === true;\n};\n\nValidatorResult.prototype.addError = function addError(detail) {\n var err;\n if (typeof detail == 'string') {\n err = new ValidationError(detail, this.instance, this.schema, this.path);\n } else {\n if (!detail) throw new Error('Missing error detail');\n if (!detail.message) throw new Error('Missing error message');\n if (!detail.name) throw new Error('Missing validator type');\n err = new ValidationError(detail.message, this.instance, this.schema, this.path, detail.name, detail.argument);\n }\n\n this.errors.push(err);\n if (this.throwFirst) {\n throw new ValidatorResultError(this);\n }else if(this.throwError){\n throw err;\n }\n return err;\n};\n\nValidatorResult.prototype.importErrors = function importErrors(res) {\n if (typeof res == 'string' || (res && res.validatorType)) {\n this.addError(res);\n } else if (res && res.errors) {\n Array.prototype.push.apply(this.errors, res.errors);\n }\n};\n\nfunction stringizer (v,i){\n return i+': '+v.toString()+'\\n';\n}\nValidatorResult.prototype.toString = function toString(res) {\n return this.errors.map(stringizer).join('');\n};\n\nObject.defineProperty(ValidatorResult.prototype, \"valid\", { get: function() {\n return !this.errors.length;\n} });\n\nmodule.exports.ValidatorResultError = ValidatorResultError;\nfunction ValidatorResultError(result) {\n if(Error.captureStackTrace){\n Error.captureStackTrace(this, ValidatorResultError);\n }\n this.instance = result.instance;\n this.schema = result.schema;\n this.options = result.options;\n this.errors = result.errors;\n}\nValidatorResultError.prototype = new Error();\nValidatorResultError.prototype.constructor = ValidatorResultError;\nValidatorResultError.prototype.name = \"Validation Error\";\n\n/**\n * Describes a problem with a Schema which prevents validation of an instance\n * @name SchemaError\n * @constructor\n */\nvar SchemaError = exports.SchemaError = function SchemaError (msg, schema) {\n this.message = msg;\n this.schema = schema;\n Error.call(this, msg);\n Error.captureStackTrace(this, SchemaError);\n};\nSchemaError.prototype = Object.create(Error.prototype,\n {\n constructor: {value: SchemaError, enumerable: false},\n name: {value: 'SchemaError', enumerable: false},\n });\n\nvar SchemaContext = exports.SchemaContext = function SchemaContext (schema, options, path, base, schemas) {\n this.schema = schema;\n this.options = options;\n if(Array.isArray(path)){\n this.path = path;\n this.propertyPath = path.reduce(function(sum, item){\n return sum + makeSuffix(item);\n }, 'instance');\n }else{\n this.propertyPath = path;\n }\n this.base = base;\n this.schemas = schemas;\n};\n\nSchemaContext.prototype.resolve = function resolve (target) {\n return uri.resolve(this.base, target);\n};\n\nSchemaContext.prototype.makeChild = function makeChild(schema, propertyName){\n var path = (propertyName===undefined) ? this.path : this.path.concat([propertyName]);\n var id = schema.$id || schema.id;\n var base = uri.resolve(this.base, id||'');\n var ctx = new SchemaContext(schema, this.options, path, base, Object.create(this.schemas));\n if(id && !ctx.schemas[base]){\n ctx.schemas[base] = schema;\n }\n return ctx;\n};\n\nvar FORMAT_REGEXPS = exports.FORMAT_REGEXPS = {\n 'date-time': /^\\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\\.\\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,\n 'date': /^\\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])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z~])*)?|([A-Za-z][+\\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\\-.0-9A-Za-z]*:)?\\/((%[0-9A-Fa-f]{2}|\\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\\[(([Vv][0-9A-Fa-f]+\\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\\])?)(:\\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\\d*)?|(\\[(([Vv][0-9A-Fa-f]+\\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\\])?:\\d*|\\[(([Vv][0-9A-Fa-f]+\\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\\])?)?|[A-Za-z][+\\-.0-9A-Za-z]*:?)?$/,\n\n 'color': /^(#?([0-9A-Fa-f]{3}){1,2}\\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\\(\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*,\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*,\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*\\))|(rgb\\(\\s*(\\d?\\d%|100%)+\\s*,\\s*(\\d?\\d%|100%)+\\s*,\\s*(\\d?\\d%|100%)+\\s*\\)))$/,\n\n // hostname regex from: http://stackoverflow.com/a/1420225/5628\n 'hostname': /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\\.?$/,\n 'host-name': /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\\.?$/,\n\n 'alpha': /^[a-zA-Z]+$/,\n 'alphanumeric': /^[a-zA-Z0-9]+$/,\n 'utc-millisec': function (input) {\n return (typeof input === 'string') && parseFloat(input) === parseInt(input, 10) && !isNaN(input);\n },\n 'regex': function (input) {\n var result = true;\n try {\n new RegExp(input);\n } catch (e) {\n result = false;\n }\n return result;\n },\n 'style': /\\s*(.+?):\\s*([^;]+);?/,\n 'phone': /^\\+(?:[0-9] ?){6,14}[0-9]$/,\n};\n\nFORMAT_REGEXPS.regexp = FORMAT_REGEXPS.regex;\nFORMAT_REGEXPS.pattern = FORMAT_REGEXPS.regex;\nFORMAT_REGEXPS.ipv4 = FORMAT_REGEXPS['ip-address'];\n\nexports.isFormat = function isFormat (input, format, validator) {\n if (typeof input === 'string' && FORMAT_REGEXPS[format] !== undefined) {\n if (FORMAT_REGEXPS[format] instanceof RegExp) {\n return FORMAT_REGEXPS[format].test(input);\n }\n if (typeof FORMAT_REGEXPS[format] === 'function') {\n return FORMAT_REGEXPS[format](input);\n }\n } else if (validator && validator.customFormats &&\n typeof validator.customFormats[format] === 'function') {\n return validator.customFormats[format](input);\n }\n return true;\n};\n\nvar makeSuffix = exports.makeSuffix = function makeSuffix (key) {\n key = key.toString();\n // This function could be capable of outputting valid a ECMAScript string, but the\n // resulting code for testing which form to use would be tens of thousands of characters long\n // That means this will use the name form for some illegal forms\n if (!key.match(/[.\\s\\[\\]]/) && !key.match(/^[\\d]/)) {\n return '.' + key;\n }\n if (key.match(/^\\d+$/)) {\n return '[' + key + ']';\n }\n return '[' + JSON.stringify(key) + ']';\n};\n\nexports.deepCompareStrict = function deepCompareStrict (a, b) {\n if (typeof a !== typeof b) {\n return false;\n }\n if (Array.isArray(a)) {\n if (!Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n return a.every(function (v, i) {\n return deepCompareStrict(a[i], b[i]);\n });\n }\n if (typeof a === 'object') {\n if (!a || !b) {\n return a === b;\n }\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n return aKeys.every(function (v) {\n return deepCompareStrict(a[v], b[v]);\n });\n }\n return a === b;\n};\n\nfunction deepMerger (target, dst, e, i) {\n if (typeof e === 'object') {\n dst[i] = deepMerge(target[i], e);\n } else {\n if (target.indexOf(e) === -1) {\n dst.push(e);\n }\n }\n}\n\nfunction copyist (src, dst, key) {\n dst[key] = src[key];\n}\n\nfunction copyistWithDeepMerge (target, src, dst, key) {\n if (typeof src[key] !== 'object' || !src[key]) {\n dst[key] = src[key];\n }\n else {\n if (!target[key]) {\n dst[key] = src[key];\n } else {\n dst[key] = deepMerge(target[key], src[key]);\n }\n }\n}\n\nfunction deepMerge (target, src) {\n var array = Array.isArray(src);\n var dst = array && [] || {};\n\n if (array) {\n target = target || [];\n dst = dst.concat(target);\n src.forEach(deepMerger.bind(null, target, dst));\n } else {\n if (target && typeof target === 'object') {\n Object.keys(target).forEach(copyist.bind(null, target, dst));\n }\n Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst));\n }\n\n return dst;\n}\n\nmodule.exports.deepMerge = deepMerge;\n\n/**\n * Validates instance against the provided schema\n * Implements URI+JSON Pointer encoding, e.g. \"%7e\"=\"~0\"=>\"~\", \"~1\"=\"%2f\"=>\"/\"\n * @param o\n * @param s The path to walk o along\n * @return any\n */\nexports.objectGetPath = function objectGetPath(o, s) {\n var parts = s.split('/').slice(1);\n var k;\n while (typeof (k=parts.shift()) == 'string') {\n var n = decodeURIComponent(k.replace(/~0/,'~').replace(/~1/g,'/'));\n if (!(n in o)) return;\n o = o[n];\n }\n return o;\n};\n\nfunction pathEncoder (v) {\n return '/'+encodeURIComponent(v).replace(/~/g,'%7E');\n}\n/**\n * Accept an Array of property names and return a JSON Pointer URI fragment\n * @param Array a\n * @return {String}\n */\nexports.encodePath = function encodePointer(a){\n // ~ must be encoded explicitly because hacks\n // the slash is encoded by encodeURIComponent\n return a.map(pathEncoder).join('');\n};\n\n\n/**\n * Calculate the number of decimal places a number uses\n * We need this to get correct results out of multipleOf and divisibleBy\n * when either figure is has decimal places, due to IEEE-754 float issues.\n * @param number\n * @returns {number}\n */\nexports.getDecimalPlaces = function getDecimalPlaces(number) {\n\n var decimalPlaces = 0;\n if (isNaN(number)) return decimalPlaces;\n\n if (typeof number !== 'number') {\n number = Number(number);\n }\n\n var parts = number.toString().split('e');\n if (parts.length === 2) {\n if (parts[1][0] !== '-') {\n return decimalPlaces;\n } else {\n decimalPlaces = Number(parts[1].slice(1));\n }\n }\n\n var decimalParts = parts[0].split('.');\n if (decimalParts.length === 2) {\n decimalPlaces += decimalParts[1].length;\n }\n\n return decimalPlaces;\n};\n\nexports.isSchema = function isSchema(val){\n return (typeof val === 'object' && val) || (typeof val === 'boolean');\n};\n\n","'use strict';\n\nvar Validator = module.exports.Validator = require('./validator');\n\nmodule.exports.ValidatorResult = require('./helpers').ValidatorResult;\nmodule.exports.ValidatorResultError = require('./helpers').ValidatorResultError;\nmodule.exports.ValidationError = require('./helpers').ValidationError;\nmodule.exports.SchemaError = require('./helpers').SchemaError;\nmodule.exports.SchemaScanResult = require('./scan').SchemaScanResult;\nmodule.exports.scan = require('./scan').scan;\n\nmodule.exports.validate = function (instance, schema, options) {\n var v = new Validator();\n return v.validate(instance, schema, options);\n};\n","\"use strict\";\n\nvar urilib = require('url');\nvar helpers = require('./helpers');\n\nmodule.exports.SchemaScanResult = SchemaScanResult;\nfunction SchemaScanResult(found, ref){\n this.id = found;\n this.ref = ref;\n}\n\n/**\n * Adds a schema with a certain urn to the Validator instance.\n * @param string uri\n * @param object schema\n * @return {Object}\n */\nmodule.exports.scan = function scan(base, schema){\n function scanSchema(baseuri, schema){\n if(!schema || typeof schema!='object') return;\n // Mark all referenced schemas so we can tell later which schemas are referred to, but never defined\n if(schema.$ref){\n var resolvedUri = urilib.resolve(baseuri, schema.$ref);\n ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri]+1 : 0;\n return;\n }\n var id = schema.$id || schema.id;\n var ourBase = id ? urilib.resolve(baseuri, id) : baseuri;\n if (ourBase) {\n // If there's no fragment, append an empty one\n if(ourBase.indexOf('#')<0) ourBase += '#';\n if(found[ourBase]){\n if(!helpers.deepCompareStrict(found[ourBase], schema)){\n throw new Error('Schema <'+ourBase+'> already exists with different definition');\n }\n return found[ourBase];\n }\n found[ourBase] = schema;\n // strip trailing fragment\n if(ourBase[ourBase.length-1]=='#'){\n found[ourBase.substring(0, ourBase.length-1)] = schema;\n }\n }\n scanArray(ourBase+'/items', (Array.isArray(schema.items)?schema.items:[schema.items]));\n scanArray(ourBase+'/extends', (Array.isArray(schema.extends)?schema.extends:[schema.extends]));\n scanSchema(ourBase+'/additionalItems', schema.additionalItems);\n scanObject(ourBase+'/properties', schema.properties);\n scanSchema(ourBase+'/additionalProperties', schema.additionalProperties);\n scanObject(ourBase+'/definitions', schema.definitions);\n scanObject(ourBase+'/patternProperties', schema.patternProperties);\n scanObject(ourBase+'/dependencies', schema.dependencies);\n scanArray(ourBase+'/disallow', schema.disallow);\n scanArray(ourBase+'/allOf', schema.allOf);\n scanArray(ourBase+'/anyOf', schema.anyOf);\n scanArray(ourBase+'/oneOf', schema.oneOf);\n scanSchema(ourBase+'/not', schema.not);\n }\n function scanArray(baseuri, schemas){\n if(!Array.isArray(schemas)) return;\n for(var i=0; i\", schema);\n }\n var subschema = helpers.objectGetPath(ctx.schemas[document], fragment.substr(1));\n if(subschema===undefined){\n throw new SchemaError(\"no such schema \" + fragment + \" located in <\" + document + \">\", schema);\n }\n return {subschema: subschema, switchSchema: switchSchema};\n};\n\n/**\n * Tests whether the instance if of a certain type.\n * @private\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @param type\n * @return {boolean}\n */\nValidator.prototype.testType = function validateType (instance, schema, options, ctx, type) {\n if(type===undefined){\n return;\n }else if(type===null){\n throw new SchemaError('Unexpected null in \"type\" keyword');\n }\n if (typeof this.types[type] == 'function') {\n return this.types[type].call(this, instance);\n }\n if (type && typeof type == 'object') {\n var res = this.validateSchema(instance, type, options, ctx);\n return res === undefined || !(res && res.errors.length);\n }\n // Undefined or properties not on the list are acceptable, same as not being defined\n return true;\n};\n\nvar types = Validator.prototype.types = {};\ntypes.string = function testString (instance) {\n return typeof instance == 'string';\n};\ntypes.number = function testNumber (instance) {\n // isFinite returns false for NaN, Infinity, and -Infinity\n return typeof instance == 'number' && isFinite(instance);\n};\ntypes.integer = function testInteger (instance) {\n return (typeof instance == 'number') && instance % 1 === 0;\n};\ntypes.boolean = function testBoolean (instance) {\n return typeof instance == 'boolean';\n};\ntypes.array = function testArray (instance) {\n return Array.isArray(instance);\n};\ntypes['null'] = function testNull (instance) {\n return instance === null;\n};\ntypes.date = function testDate (instance) {\n return instance instanceof Date;\n};\ntypes.any = function testAny (instance) {\n return true;\n};\ntypes.object = function testObject (instance) {\n // TODO: fix this - see #15\n return instance && (typeof instance === 'object') && !(Array.isArray(instance)) && !(instance instanceof Date);\n};\n\nmodule.exports = Validator;\n","'use strict'\nconst EE = require('events')\nconst Stream = require('stream')\nconst Yallist = require('yallist')\nconst SD = require('string_decoder').StringDecoder\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\nconst DESTROYED = Symbol('destroyed')\n\n// TODO remove when Node v8 support drops\nconst doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1'\nconst ASYNCITERATOR = doIter && Symbol.asyncIterator\n || Symbol('asyncIterator not implemented')\nconst ITERATOR = doIter && Symbol.iterator\n || Symbol('iterator not implemented')\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\nconst isEndish = ev =>\n ev === 'end' ||\n ev === 'finish' ||\n ev === 'prefinish'\n\nconst isArrayBuffer = b => b instanceof ArrayBuffer ||\n typeof b === 'object' &&\n b.constructor &&\n b.constructor.name === 'ArrayBuffer' &&\n b.byteLength >= 0\n\nconst isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\nmodule.exports = class Minipass extends Stream {\n constructor (options) {\n super()\n this[FLOWING] = false\n // whether we're explicitly paused\n this[PAUSED] = false\n this.pipes = new Yallist()\n this.buffer = new Yallist()\n this[OBJECTMODE] = options && options.objectMode || false\n if (this[OBJECTMODE])\n this[ENCODING] = null\n else\n this[ENCODING] = options && options.encoding || null\n if (this[ENCODING] === 'buffer')\n this[ENCODING] = null\n this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null\n this[EOF] = false\n this[EMITTED_END] = false\n this[EMITTING_END] = false\n this[CLOSED] = false\n this.writable = true\n this.readable = true\n this[BUFFERLENGTH] = 0\n this[DESTROYED] = false\n }\n\n get bufferLength () { return this[BUFFERLENGTH] }\n\n get encoding () { return this[ENCODING] }\n set encoding (enc) {\n if (this[OBJECTMODE])\n throw new Error('cannot set encoding in objectMode')\n\n if (this[ENCODING] && enc !== this[ENCODING] &&\n (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH]))\n throw new Error('cannot change encoding')\n\n if (this[ENCODING] !== enc) {\n this[DECODER] = enc ? new SD(enc) : null\n if (this.buffer.length)\n this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk))\n }\n\n this[ENCODING] = enc\n }\n\n setEncoding (enc) {\n this.encoding = enc\n }\n\n get objectMode () { return this[OBJECTMODE] }\n set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om }\n\n write (chunk, encoding, cb) {\n if (this[EOF])\n throw new Error('write after end')\n\n if (this[DESTROYED]) {\n this.emit('error', Object.assign(\n new Error('Cannot call write after a stream was destroyed'),\n { code: 'ERR_STREAM_DESTROYED' }\n ))\n return true\n }\n\n if (typeof encoding === 'function')\n cb = encoding, encoding = 'utf8'\n\n if (!encoding)\n encoding = 'utf8'\n\n // convert array buffers and typed array views into buffers\n // at some point in the future, we may want to do the opposite!\n // leave strings and buffers as-is\n // anything else switches us into object mode\n if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n if (isArrayBufferView(chunk))\n chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n else if (isArrayBuffer(chunk))\n chunk = Buffer.from(chunk)\n else if (typeof chunk !== 'string')\n // use the setter so we throw if we have encoding set\n this.objectMode = true\n }\n\n // this ensures at this point that the chunk is a buffer or string\n // don't buffer it up or send it to the decoder\n if (!this.objectMode && !chunk.length) {\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable')\n if (cb)\n cb()\n return this.flowing\n }\n\n // fast-path writing strings of same encoding to a stream with\n // an empty buffer, skipping the buffer/decoder dance\n if (typeof chunk === 'string' && !this[OBJECTMODE] &&\n // unless it is a string already ready for us to use\n !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) {\n chunk = Buffer.from(chunk, encoding)\n }\n\n if (Buffer.isBuffer(chunk) && this[ENCODING])\n chunk = this[DECODER].write(chunk)\n\n if (this.flowing) {\n // if we somehow have something in the buffer, but we think we're\n // flowing, then we need to flush all that out first, or we get\n // chunks coming in out of order. Can't emit 'drain' here though,\n // because we're mid-write, so that'd be bad.\n if (this[BUFFERLENGTH] !== 0)\n this[FLUSH](true)\n this.emit('data', chunk)\n } else\n this[BUFFERPUSH](chunk)\n\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable')\n\n if (cb)\n cb()\n\n return this.flowing\n }\n\n read (n) {\n if (this[DESTROYED])\n return null\n\n try {\n if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH])\n return null\n\n if (this[OBJECTMODE])\n n = null\n\n if (this.buffer.length > 1 && !this[OBJECTMODE]) {\n if (this.encoding)\n this.buffer = new Yallist([\n Array.from(this.buffer).join('')\n ])\n else\n this.buffer = new Yallist([\n Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH])\n ])\n }\n\n return this[READ](n || null, this.buffer.head.value)\n } finally {\n this[MAYBE_EMIT_END]()\n }\n }\n\n [READ] (n, chunk) {\n if (n === chunk.length || n === null)\n this[BUFFERSHIFT]()\n else {\n this.buffer.head.value = chunk.slice(n)\n chunk = chunk.slice(0, n)\n this[BUFFERLENGTH] -= n\n }\n\n this.emit('data', chunk)\n\n if (!this.buffer.length && !this[EOF])\n this.emit('drain')\n\n return chunk\n }\n\n end (chunk, encoding, cb) {\n if (typeof chunk === 'function')\n cb = chunk, chunk = null\n if (typeof encoding === 'function')\n cb = encoding, encoding = 'utf8'\n if (chunk)\n this.write(chunk, encoding)\n if (cb)\n this.once('end', cb)\n this[EOF] = true\n this.writable = false\n\n // if we haven't written anything, then go ahead and emit,\n // even if we're not reading.\n // we'll re-emit if a new 'end' listener is added anyway.\n // This makes MP more suitable to write-only use cases.\n if (this.flowing || !this[PAUSED])\n this[MAYBE_EMIT_END]()\n return this\n }\n\n // don't let the internal resume be overwritten\n [RESUME] () {\n if (this[DESTROYED])\n return\n\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this.buffer.length)\n this[FLUSH]()\n else if (this[EOF])\n this[MAYBE_EMIT_END]()\n else\n this.emit('drain')\n }\n\n resume () {\n return this[RESUME]()\n }\n\n pause () {\n this[FLOWING] = false\n this[PAUSED] = true\n }\n\n get destroyed () {\n return this[DESTROYED]\n }\n\n get flowing () {\n return this[FLOWING]\n }\n\n get paused () {\n return this[PAUSED]\n }\n\n [BUFFERPUSH] (chunk) {\n if (this[OBJECTMODE])\n this[BUFFERLENGTH] += 1\n else\n this[BUFFERLENGTH] += chunk.length\n return this.buffer.push(chunk)\n }\n\n [BUFFERSHIFT] () {\n if (this.buffer.length) {\n if (this[OBJECTMODE])\n this[BUFFERLENGTH] -= 1\n else\n this[BUFFERLENGTH] -= this.buffer.head.value.length\n }\n return this.buffer.shift()\n }\n\n [FLUSH] (noDrain) {\n do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()))\n\n if (!noDrain && !this.buffer.length && !this[EOF])\n this.emit('drain')\n }\n\n [FLUSHCHUNK] (chunk) {\n return chunk ? (this.emit('data', chunk), this.flowing) : false\n }\n\n pipe (dest, opts) {\n if (this[DESTROYED])\n return\n\n const ended = this[EMITTED_END]\n opts = opts || {}\n if (dest === process.stdout || dest === process.stderr)\n opts.end = false\n else\n opts.end = opts.end !== false\n\n const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() }\n this.pipes.push(p)\n\n dest.on('drain', p.ondrain)\n this[RESUME]()\n // piping an ended stream ends immediately\n if (ended && p.opts.end)\n p.dest.end()\n return dest\n }\n\n addListener (ev, fn) {\n return this.on(ev, fn)\n }\n\n on (ev, fn) {\n try {\n return super.on(ev, fn)\n } finally {\n if (ev === 'data' && !this.pipes.length && !this.flowing)\n this[RESUME]()\n else if (isEndish(ev) && this[EMITTED_END]) {\n super.emit(ev)\n this.removeAllListeners(ev)\n }\n }\n }\n\n get emittedEnd () {\n return this[EMITTED_END]\n }\n\n [MAYBE_EMIT_END] () {\n if (!this[EMITTING_END] &&\n !this[EMITTED_END] &&\n !this[DESTROYED] &&\n this.buffer.length === 0 &&\n this[EOF]) {\n this[EMITTING_END] = true\n this.emit('end')\n this.emit('prefinish')\n this.emit('finish')\n if (this[CLOSED])\n this.emit('close')\n this[EMITTING_END] = false\n }\n }\n\n emit (ev, data) {\n // error and close are only events allowed after calling destroy()\n if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED])\n return\n else if (ev === 'data') {\n if (!data)\n return\n\n if (this.pipes.length)\n this.pipes.forEach(p =>\n p.dest.write(data) === false && this.pause())\n } else if (ev === 'end') {\n // only actual end gets this treatment\n if (this[EMITTED_END] === true)\n return\n\n this[EMITTED_END] = true\n this.readable = false\n\n if (this[DECODER]) {\n data = this[DECODER].end()\n if (data) {\n this.pipes.forEach(p => p.dest.write(data))\n super.emit('data', data)\n }\n }\n\n this.pipes.forEach(p => {\n p.dest.removeListener('drain', p.ondrain)\n if (p.opts.end)\n p.dest.end()\n })\n } else if (ev === 'close') {\n this[CLOSED] = true\n // don't emit close before 'end' and 'finish'\n if (!this[EMITTED_END] && !this[DESTROYED])\n return\n }\n\n // TODO: replace with a spread operator when Node v4 support drops\n const args = new Array(arguments.length)\n args[0] = ev\n args[1] = data\n if (arguments.length > 2) {\n for (let i = 2; i < arguments.length; i++) {\n args[i] = arguments[i]\n }\n }\n\n try {\n return super.emit.apply(this, args)\n } finally {\n if (!isEndish(ev))\n this[MAYBE_EMIT_END]()\n else\n this.removeAllListeners(ev)\n }\n }\n\n // const all = await stream.collect()\n collect () {\n const buf = []\n if (!this[OBJECTMODE])\n buf.dataLength = 0\n // set the promise first, in case an error is raised\n // by triggering the flow here.\n const p = this.promise()\n this.on('data', c => {\n buf.push(c)\n if (!this[OBJECTMODE])\n buf.dataLength += c.length\n })\n return p.then(() => buf)\n }\n\n // const data = await stream.concat()\n concat () {\n return this[OBJECTMODE]\n ? Promise.reject(new Error('cannot concat in objectMode'))\n : this.collect().then(buf =>\n this[OBJECTMODE]\n ? Promise.reject(new Error('cannot concat in objectMode'))\n : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength))\n }\n\n // stream.promise().then(() => done, er => emitted error)\n promise () {\n return new Promise((resolve, reject) => {\n this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n this.on('end', () => resolve())\n this.on('error', er => reject(er))\n })\n }\n\n // for await (let chunk of stream)\n [ASYNCITERATOR] () {\n const next = () => {\n const res = this.read()\n if (res !== null)\n return Promise.resolve({ done: false, value: res })\n\n if (this[EOF])\n return Promise.resolve({ done: true })\n\n let resolve = null\n let reject = null\n const onerr = er => {\n this.removeListener('data', ondata)\n this.removeListener('end', onend)\n reject(er)\n }\n const ondata = value => {\n this.removeListener('error', onerr)\n this.removeListener('end', onend)\n this.pause()\n resolve({ value: value, done: !!this[EOF] })\n }\n const onend = () => {\n this.removeListener('error', onerr)\n this.removeListener('data', ondata)\n resolve({ done: true })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return { next }\n }\n\n // for (let chunk of stream)\n [ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }\n\n destroy (er) {\n if (this[DESTROYED]) {\n if (er)\n this.emit('error', er)\n else\n this.emit(DESTROYED)\n return this\n }\n\n this[DESTROYED] = true\n\n // throw away all buffered data, it's never coming out\n this.buffer = new Yallist()\n this[BUFFERLENGTH] = 0\n\n if (typeof this.close === 'function' && !this[CLOSED])\n this.close()\n\n if (er)\n this.emit('error', er)\n else // if no error to emit, still reject pending promises\n this.emit(DESTROYED)\n\n return this\n }\n\n static isStream (s) {\n return !!s && (s instanceof Minipass || s instanceof Stream ||\n s instanceof EE && (\n typeof s.pipe === 'function' || // readable\n (typeof s.write === 'function' && typeof s.end === 'function') // writable\n ))\n }\n}\n","// Update with any zlib constants that are added or changed in the future.\n// Node v6 didn't export this, so we just hard code the version and rely\n// on all the other hard-coded values from zlib v4736. When node v6\n// support drops, we can just export the realZlibConstants object.\nconst realZlibConstants = require('zlib').constants ||\n /* istanbul ignore next */ { ZLIB_VERNUM: 4736 }\n\nmodule.exports = Object.freeze(Object.assign(Object.create(null), {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n Z_VERSION_ERROR: -6,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n DEFLATE: 1,\n INFLATE: 2,\n GZIP: 3,\n GUNZIP: 4,\n DEFLATERAW: 5,\n INFLATERAW: 6,\n UNZIP: 7,\n BROTLI_DECODE: 8,\n BROTLI_ENCODE: 9,\n Z_MIN_WINDOWBITS: 8,\n Z_MAX_WINDOWBITS: 15,\n Z_DEFAULT_WINDOWBITS: 15,\n Z_MIN_CHUNK: 64,\n Z_MAX_CHUNK: Infinity,\n Z_DEFAULT_CHUNK: 16384,\n Z_MIN_MEMLEVEL: 1,\n Z_MAX_MEMLEVEL: 9,\n Z_DEFAULT_MEMLEVEL: 8,\n Z_MIN_LEVEL: -1,\n Z_MAX_LEVEL: 9,\n Z_DEFAULT_LEVEL: -1,\n BROTLI_OPERATION_PROCESS: 0,\n BROTLI_OPERATION_FLUSH: 1,\n BROTLI_OPERATION_FINISH: 2,\n BROTLI_OPERATION_EMIT_METADATA: 3,\n BROTLI_MODE_GENERIC: 0,\n BROTLI_MODE_TEXT: 1,\n BROTLI_MODE_FONT: 2,\n BROTLI_DEFAULT_MODE: 0,\n BROTLI_MIN_QUALITY: 0,\n BROTLI_MAX_QUALITY: 11,\n BROTLI_DEFAULT_QUALITY: 11,\n BROTLI_MIN_WINDOW_BITS: 10,\n BROTLI_MAX_WINDOW_BITS: 24,\n BROTLI_LARGE_MAX_WINDOW_BITS: 30,\n BROTLI_DEFAULT_WINDOW: 22,\n BROTLI_MIN_INPUT_BLOCK_BITS: 16,\n BROTLI_MAX_INPUT_BLOCK_BITS: 24,\n BROTLI_PARAM_MODE: 0,\n BROTLI_PARAM_QUALITY: 1,\n BROTLI_PARAM_LGWIN: 2,\n BROTLI_PARAM_LGBLOCK: 3,\n BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4,\n BROTLI_PARAM_SIZE_HINT: 5,\n BROTLI_PARAM_LARGE_WINDOW: 6,\n BROTLI_PARAM_NPOSTFIX: 7,\n BROTLI_PARAM_NDIRECT: 8,\n BROTLI_DECODER_RESULT_ERROR: 0,\n BROTLI_DECODER_RESULT_SUCCESS: 1,\n BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2,\n BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3,\n BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0,\n BROTLI_DECODER_PARAM_LARGE_WINDOW: 1,\n BROTLI_DECODER_NO_ERROR: 0,\n BROTLI_DECODER_SUCCESS: 1,\n BROTLI_DECODER_NEEDS_MORE_INPUT: 2,\n BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3,\n BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1,\n BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2,\n BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3,\n BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4,\n BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5,\n BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6,\n BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7,\n BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8,\n BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9,\n BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10,\n BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11,\n BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12,\n BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13,\n BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14,\n BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15,\n BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16,\n BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19,\n BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20,\n BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21,\n BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22,\n BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25,\n BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26,\n BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27,\n BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30,\n BROTLI_DECODER_ERROR_UNREACHABLE: -31,\n}, realZlibConstants))\n","'use strict'\n\nconst assert = require('assert')\nconst Buffer = require('buffer').Buffer\nconst realZlib = require('zlib')\n\nconst constants = exports.constants = require('./constants.js')\nconst Minipass = require('minipass')\n\nconst OriginalBufferConcat = Buffer.concat\n\nconst _superWrite = Symbol('_superWrite')\nclass ZlibError extends Error {\n constructor (err) {\n super('zlib: ' + err.message)\n this.code = err.code\n this.errno = err.errno\n /* istanbul ignore if */\n if (!this.code)\n this.code = 'ZLIB_ERROR'\n\n this.message = 'zlib: ' + err.message\n Error.captureStackTrace(this, this.constructor)\n }\n\n get name () {\n return 'ZlibError'\n }\n}\n\n// the Zlib class they all inherit from\n// This thing manages the queue of requests, and returns\n// true or false if there is anything in the queue when\n// you call the .write() method.\nconst _opts = Symbol('opts')\nconst _flushFlag = Symbol('flushFlag')\nconst _finishFlushFlag = Symbol('finishFlushFlag')\nconst _fullFlushFlag = Symbol('fullFlushFlag')\nconst _handle = Symbol('handle')\nconst _onError = Symbol('onError')\nconst _sawError = Symbol('sawError')\nconst _level = Symbol('level')\nconst _strategy = Symbol('strategy')\nconst _ended = Symbol('ended')\nconst _defaultFullFlush = Symbol('_defaultFullFlush')\n\nclass ZlibBase extends Minipass {\n constructor (opts, mode) {\n if (!opts || typeof opts !== 'object')\n throw new TypeError('invalid options for ZlibBase constructor')\n\n super(opts)\n this[_sawError] = false\n this[_ended] = false\n this[_opts] = opts\n\n this[_flushFlag] = opts.flush\n this[_finishFlushFlag] = opts.finishFlush\n // this will throw if any options are invalid for the class selected\n try {\n this[_handle] = new realZlib[mode](opts)\n } catch (er) {\n // make sure that all errors get decorated properly\n throw new ZlibError(er)\n }\n\n this[_onError] = (err) => {\n // no sense raising multiple errors, since we abort on the first one.\n if (this[_sawError])\n return\n\n this[_sawError] = true\n\n // there is no way to cleanly recover.\n // continuing only obscures problems.\n this.close()\n this.emit('error', err)\n }\n\n this[_handle].on('error', er => this[_onError](new ZlibError(er)))\n this.once('end', () => this.close)\n }\n\n close () {\n if (this[_handle]) {\n this[_handle].close()\n this[_handle] = null\n this.emit('close')\n }\n }\n\n reset () {\n if (!this[_sawError]) {\n assert(this[_handle], 'zlib binding closed')\n return this[_handle].reset()\n }\n }\n\n flush (flushFlag) {\n if (this.ended)\n return\n\n if (typeof flushFlag !== 'number')\n flushFlag = this[_fullFlushFlag]\n this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag }))\n }\n\n end (chunk, encoding, cb) {\n if (chunk)\n this.write(chunk, encoding)\n this.flush(this[_finishFlushFlag])\n this[_ended] = true\n return super.end(null, null, cb)\n }\n\n get ended () {\n return this[_ended]\n }\n\n write (chunk, encoding, cb) {\n // process the chunk using the sync process\n // then super.write() all the outputted chunks\n if (typeof encoding === 'function')\n cb = encoding, encoding = 'utf8'\n\n if (typeof chunk === 'string')\n chunk = Buffer.from(chunk, encoding)\n\n if (this[_sawError])\n return\n assert(this[_handle], 'zlib binding closed')\n\n // _processChunk tries to .close() the native handle after it's done, so we\n // intercept that by temporarily making it a no-op.\n const nativeHandle = this[_handle]._handle\n const originalNativeClose = nativeHandle.close\n nativeHandle.close = () => {}\n const originalClose = this[_handle].close\n this[_handle].close = () => {}\n // It also calls `Buffer.concat()` at the end, which may be convenient\n // for some, but which we are not interested in as it slows us down.\n Buffer.concat = (args) => args\n let result\n try {\n const flushFlag = typeof chunk[_flushFlag] === 'number'\n ? chunk[_flushFlag] : this[_flushFlag]\n result = this[_handle]._processChunk(chunk, flushFlag)\n // if we don't throw, reset it back how it was\n Buffer.concat = OriginalBufferConcat\n } catch (err) {\n // or if we do, put Buffer.concat() back before we emit error\n // Error events call into user code, which may call Buffer.concat()\n Buffer.concat = OriginalBufferConcat\n this[_onError](new ZlibError(err))\n } finally {\n if (this[_handle]) {\n // Core zlib resets `_handle` to null after attempting to close the\n // native handle. Our no-op handler prevented actual closure, but we\n // need to restore the `._handle` property.\n this[_handle]._handle = nativeHandle\n nativeHandle.close = originalNativeClose\n this[_handle].close = originalClose\n // `_processChunk()` adds an 'error' listener. If we don't remove it\n // after each call, these handlers start piling up.\n this[_handle].removeAllListeners('error')\n // make sure OUR error listener is still attached tho\n }\n }\n\n if (this[_handle])\n this[_handle].on('error', er => this[_onError](new ZlibError(er)))\n\n let writeReturn\n if (result) {\n if (Array.isArray(result) && result.length > 0) {\n // The first buffer is always `handle._outBuffer`, which would be\n // re-used for later invocations; so, we always have to copy that one.\n writeReturn = this[_superWrite](Buffer.from(result[0]))\n for (let i = 1; i < result.length; i++) {\n writeReturn = this[_superWrite](result[i])\n }\n } else {\n writeReturn = this[_superWrite](Buffer.from(result))\n }\n }\n\n if (cb)\n cb()\n return writeReturn\n }\n\n [_superWrite] (data) {\n return super.write(data)\n }\n}\n\nclass Zlib extends ZlibBase {\n constructor (opts, mode) {\n opts = opts || {}\n\n opts.flush = opts.flush || constants.Z_NO_FLUSH\n opts.finishFlush = opts.finishFlush || constants.Z_FINISH\n super(opts, mode)\n\n this[_fullFlushFlag] = constants.Z_FULL_FLUSH\n this[_level] = opts.level\n this[_strategy] = opts.strategy\n }\n\n params (level, strategy) {\n if (this[_sawError])\n return\n\n if (!this[_handle])\n throw new Error('cannot switch params when binding is closed')\n\n // no way to test this without also not supporting params at all\n /* istanbul ignore if */\n if (!this[_handle].params)\n throw new Error('not supported in this implementation')\n\n if (this[_level] !== level || this[_strategy] !== strategy) {\n this.flush(constants.Z_SYNC_FLUSH)\n assert(this[_handle], 'zlib binding closed')\n // .params() calls .flush(), but the latter is always async in the\n // core zlib. We override .flush() temporarily to intercept that and\n // flush synchronously.\n const origFlush = this[_handle].flush\n this[_handle].flush = (flushFlag, cb) => {\n this.flush(flushFlag)\n cb()\n }\n try {\n this[_handle].params(level, strategy)\n } finally {\n this[_handle].flush = origFlush\n }\n /* istanbul ignore else */\n if (this[_handle]) {\n this[_level] = level\n this[_strategy] = strategy\n }\n }\n }\n}\n\n// minimal 2-byte header\nclass Deflate extends Zlib {\n constructor (opts) {\n super(opts, 'Deflate')\n }\n}\n\nclass Inflate extends Zlib {\n constructor (opts) {\n super(opts, 'Inflate')\n }\n}\n\n// gzip - bigger header, same deflate compression\nconst _portable = Symbol('_portable')\nclass Gzip extends Zlib {\n constructor (opts) {\n super(opts, 'Gzip')\n this[_portable] = opts && !!opts.portable\n }\n\n [_superWrite] (data) {\n if (!this[_portable])\n return super[_superWrite](data)\n\n // we'll always get the header emitted in one first chunk\n // overwrite the OS indicator byte with 0xFF\n this[_portable] = false\n data[9] = 255\n return super[_superWrite](data)\n }\n}\n\nclass Gunzip extends Zlib {\n constructor (opts) {\n super(opts, 'Gunzip')\n }\n}\n\n// raw - no header\nclass DeflateRaw extends Zlib {\n constructor (opts) {\n super(opts, 'DeflateRaw')\n }\n}\n\nclass InflateRaw extends Zlib {\n constructor (opts) {\n super(opts, 'InflateRaw')\n }\n}\n\n// auto-detect header.\nclass Unzip extends Zlib {\n constructor (opts) {\n super(opts, 'Unzip')\n }\n}\n\nclass Brotli extends ZlibBase {\n constructor (opts, mode) {\n opts = opts || {}\n\n opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS\n opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH\n\n super(opts, mode)\n\n this[_fullFlushFlag] = constants.BROTLI_OPERATION_FLUSH\n }\n}\n\nclass BrotliCompress extends Brotli {\n constructor (opts) {\n super(opts, 'BrotliCompress')\n }\n}\n\nclass BrotliDecompress extends Brotli {\n constructor (opts) {\n super(opts, 'BrotliDecompress')\n }\n}\n\nexports.Deflate = Deflate\nexports.Inflate = Inflate\nexports.Gzip = Gzip\nexports.Gunzip = Gunzip\nexports.DeflateRaw = DeflateRaw\nexports.InflateRaw = InflateRaw\nexports.Unzip = Unzip\n/* istanbul ignore else */\nif (typeof realZlib.BrotliCompress === 'function') {\n exports.BrotliCompress = BrotliCompress\n exports.BrotliDecompress = BrotliDecompress\n} else {\n exports.BrotliCompress = exports.BrotliDecompress = class {\n constructor () {\n throw new Error('Brotli is not supported in this version of Node.js')\n }\n }\n}\n","const optsArg = require('./lib/opts-arg.js')\nconst pathArg = require('./lib/path-arg.js')\n\nconst {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js')\nconst {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js')\nconst {useNative, useNativeSync} = require('./lib/use-native.js')\n\n\nconst mkdirp = (path, opts) => {\n path = pathArg(path)\n opts = optsArg(opts)\n return useNative(opts)\n ? mkdirpNative(path, opts)\n : mkdirpManual(path, opts)\n}\n\nconst mkdirpSync = (path, opts) => {\n path = pathArg(path)\n opts = optsArg(opts)\n return useNativeSync(opts)\n ? mkdirpNativeSync(path, opts)\n : mkdirpManualSync(path, opts)\n}\n\nmkdirp.sync = mkdirpSync\nmkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts))\nmkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts))\nmkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts))\nmkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts))\n\nmodule.exports = mkdirp\n","const {dirname} = require('path')\n\nconst findMade = (opts, parent, path = undefined) => {\n // we never want the 'made' return value to be a root directory\n if (path === parent)\n return Promise.resolve()\n\n return opts.statAsync(parent).then(\n st => st.isDirectory() ? path : undefined, // will fail later\n er => er.code === 'ENOENT'\n ? findMade(opts, dirname(parent), parent)\n : undefined\n )\n}\n\nconst findMadeSync = (opts, parent, path = undefined) => {\n if (path === parent)\n return undefined\n\n try {\n return opts.statSync(parent).isDirectory() ? path : undefined\n } catch (er) {\n return er.code === 'ENOENT'\n ? findMadeSync(opts, dirname(parent), parent)\n : undefined\n }\n}\n\nmodule.exports = {findMade, findMadeSync}\n","const {dirname} = require('path')\n\nconst mkdirpManual = (path, opts, made) => {\n opts.recursive = false\n const parent = dirname(path)\n if (parent === path) {\n return opts.mkdirAsync(path, opts).catch(er => {\n // swallowed by recursive implementation on posix systems\n // any other error is a failure\n if (er.code !== 'EISDIR')\n throw er\n })\n }\n\n return opts.mkdirAsync(path, opts).then(() => made || path, er => {\n if (er.code === 'ENOENT')\n return mkdirpManual(parent, opts)\n .then(made => mkdirpManual(path, opts, made))\n if (er.code !== 'EEXIST' && er.code !== 'EROFS')\n throw er\n return opts.statAsync(path).then(st => {\n if (st.isDirectory())\n return made\n else\n throw er\n }, () => { throw er })\n })\n}\n\nconst mkdirpManualSync = (path, opts, made) => {\n const parent = dirname(path)\n opts.recursive = false\n\n if (parent === path) {\n try {\n return opts.mkdirSync(path, opts)\n } catch (er) {\n // swallowed by recursive implementation on posix systems\n // any other error is a failure\n if (er.code !== 'EISDIR')\n throw er\n else\n return\n }\n }\n\n try {\n opts.mkdirSync(path, opts)\n return made || path\n } catch (er) {\n if (er.code === 'ENOENT')\n return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made))\n if (er.code !== 'EEXIST' && er.code !== 'EROFS')\n throw er\n try {\n if (!opts.statSync(path).isDirectory())\n throw er\n } catch (_) {\n throw er\n }\n }\n}\n\nmodule.exports = {mkdirpManual, mkdirpManualSync}\n","const {dirname} = require('path')\nconst {findMade, findMadeSync} = require('./find-made.js')\nconst {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js')\n\nconst mkdirpNative = (path, opts) => {\n opts.recursive = true\n const parent = dirname(path)\n if (parent === path)\n return opts.mkdirAsync(path, opts)\n\n return findMade(opts, path).then(made =>\n opts.mkdirAsync(path, opts).then(() => made)\n .catch(er => {\n if (er.code === 'ENOENT')\n return mkdirpManual(path, opts)\n else\n throw er\n }))\n}\n\nconst mkdirpNativeSync = (path, opts) => {\n opts.recursive = true\n const parent = dirname(path)\n if (parent === path)\n return opts.mkdirSync(path, opts)\n\n const made = findMadeSync(opts, path)\n try {\n opts.mkdirSync(path, opts)\n return made\n } catch (er) {\n if (er.code === 'ENOENT')\n return mkdirpManualSync(path, opts)\n else\n throw er\n }\n}\n\nmodule.exports = {mkdirpNative, mkdirpNativeSync}\n","const { promisify } = require('util')\nconst fs = require('fs')\nconst optsArg = opts => {\n if (!opts)\n opts = { mode: 0o777, fs }\n else if (typeof opts === 'object')\n opts = { mode: 0o777, fs, ...opts }\n else if (typeof opts === 'number')\n opts = { mode: opts, fs }\n else if (typeof opts === 'string')\n opts = { mode: parseInt(opts, 8), fs }\n else\n throw new TypeError('invalid options argument')\n\n opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir\n opts.mkdirAsync = promisify(opts.mkdir)\n opts.stat = opts.stat || opts.fs.stat || fs.stat\n opts.statAsync = promisify(opts.stat)\n opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync\n opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync\n return opts\n}\nmodule.exports = optsArg\n","const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform\nconst { resolve, parse } = require('path')\nconst pathArg = path => {\n if (/\\0/.test(path)) {\n // simulate same failure that node raises\n throw Object.assign(\n new TypeError('path must be a string without null bytes'),\n {\n path,\n code: 'ERR_INVALID_ARG_VALUE',\n }\n )\n }\n\n path = resolve(path)\n if (platform === 'win32') {\n const badWinChars = /[*|\"<>?:]/\n const {root} = parse(path)\n if (badWinChars.test(path.substr(root.length))) {\n throw Object.assign(new Error('Illegal characters in path.'), {\n path,\n code: 'EINVAL',\n })\n }\n }\n\n return path\n}\nmodule.exports = pathArg\n","const fs = require('fs')\n\nconst version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version\nconst versArr = version.replace(/^v/, '').split('.')\nconst hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12\n\nconst useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir\nconst useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync\n\nmodule.exports = {useNative, useNativeSync}\n","'use strict'\n\n// high-level commands\nexports.c = exports.create = require('./lib/create.js')\nexports.r = exports.replace = require('./lib/replace.js')\nexports.t = exports.list = require('./lib/list.js')\nexports.u = exports.update = require('./lib/update.js')\nexports.x = exports.extract = require('./lib/extract.js')\n\n// classes\nexports.Pack = require('./lib/pack.js')\nexports.Unpack = require('./lib/unpack.js')\nexports.Parse = require('./lib/parse.js')\nexports.ReadEntry = require('./lib/read-entry.js')\nexports.WriteEntry = require('./lib/write-entry.js')\nexports.Header = require('./lib/header.js')\nexports.Pax = require('./lib/pax.js')\nexports.types = require('./lib/types.js')\n","'use strict'\n\n// tar -c\nconst hlo = require('./high-level-opt.js')\n\nconst Pack = require('./pack.js')\nconst fsm = require('fs-minipass')\nconst t = require('./list.js')\nconst path = require('path')\n\nmodule.exports = (opt_, files, cb) => {\n if (typeof files === 'function')\n cb = files\n\n if (Array.isArray(opt_))\n files = opt_, opt_ = {}\n\n if (!files || !Array.isArray(files) || !files.length)\n throw new TypeError('no files or directories specified')\n\n files = Array.from(files)\n\n const opt = hlo(opt_)\n\n if (opt.sync && typeof cb === 'function')\n throw new TypeError('callback not supported for sync tar functions')\n\n if (!opt.file && typeof cb === 'function')\n throw new TypeError('callback only supported with file option')\n\n return opt.file && opt.sync ? createFileSync(opt, files)\n : opt.file ? createFile(opt, files, cb)\n : opt.sync ? createSync(opt, files)\n : create(opt, files)\n}\n\nconst createFileSync = (opt, files) => {\n const p = new Pack.Sync(opt)\n const stream = new fsm.WriteStreamSync(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream)\n addFilesSync(p, files)\n}\n\nconst createFile = (opt, files, cb) => {\n const p = new Pack(opt)\n const stream = new fsm.WriteStream(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream)\n\n const promise = new Promise((res, rej) => {\n stream.on('error', rej)\n stream.on('close', res)\n p.on('error', rej)\n })\n\n addFilesAsync(p, files)\n\n return cb ? promise.then(cb, cb) : promise\n}\n\nconst addFilesSync = (p, files) => {\n files.forEach(file => {\n if (file.charAt(0) === '@') {\n t({\n file: path.resolve(p.cwd, file.substr(1)),\n sync: true,\n noResume: true,\n onentry: entry => p.add(entry),\n })\n } else\n p.add(file)\n })\n p.end()\n}\n\nconst addFilesAsync = (p, files) => {\n while (files.length) {\n const file = files.shift()\n if (file.charAt(0) === '@') {\n return t({\n file: path.resolve(p.cwd, file.substr(1)),\n noResume: true,\n onentry: entry => p.add(entry),\n }).then(_ => addFilesAsync(p, files))\n } else\n p.add(file)\n }\n p.end()\n}\n\nconst createSync = (opt, files) => {\n const p = new Pack.Sync(opt)\n addFilesSync(p, files)\n return p\n}\n\nconst create = (opt, files) => {\n const p = new Pack(opt)\n addFilesAsync(p, files)\n return p\n}\n","'use strict'\n\n// tar -x\nconst hlo = require('./high-level-opt.js')\nconst Unpack = require('./unpack.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst path = require('path')\n\nmodule.exports = (opt_, files, cb) => {\n if (typeof opt_ === 'function')\n cb = opt_, files = null, opt_ = {}\n else if (Array.isArray(opt_))\n files = opt_, opt_ = {}\n\n if (typeof files === 'function')\n cb = files, files = null\n\n if (!files)\n files = []\n else\n files = Array.from(files)\n\n const opt = hlo(opt_)\n\n if (opt.sync && typeof cb === 'function')\n throw new TypeError('callback not supported for sync tar functions')\n\n if (!opt.file && typeof cb === 'function')\n throw new TypeError('callback only supported with file option')\n\n if (files.length)\n filesFilter(opt, files)\n\n return opt.file && opt.sync ? extractFileSync(opt)\n : opt.file ? extractFile(opt, cb)\n : opt.sync ? extractSync(opt)\n : extract(opt)\n}\n\n// construct a filter that limits the file entries listed\n// include child entries if a dir is included\nconst filesFilter = (opt, files) => {\n const map = new Map(files.map(f => [f.replace(/\\/+$/, ''), true]))\n const filter = opt.filter\n\n const mapHas = (file, r) => {\n const root = r || path.parse(file).root || '.'\n const ret = file === root ? false\n : map.has(file) ? map.get(file)\n : mapHas(path.dirname(file), root)\n\n map.set(file, ret)\n return ret\n }\n\n opt.filter = filter\n ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\\/+$/, ''))\n : file => mapHas(file.replace(/\\/+$/, ''))\n}\n\nconst extractFileSync = opt => {\n const u = new Unpack.Sync(opt)\n\n const file = opt.file\n const stat = fs.statSync(file)\n // This trades a zero-byte read() syscall for a stat\n // However, it will usually result in less memory allocation\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n const stream = new fsm.ReadStreamSync(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.pipe(u)\n}\n\nconst extractFile = (opt, cb) => {\n const u = new Unpack(opt)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n\n const file = opt.file\n const p = new Promise((resolve, reject) => {\n u.on('error', reject)\n u.on('close', resolve)\n\n // This trades a zero-byte read() syscall for a stat\n // However, it will usually result in less memory allocation\n fs.stat(file, (er, stat) => {\n if (er)\n reject(er)\n else {\n const stream = new fsm.ReadStream(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.on('error', reject)\n stream.pipe(u)\n }\n })\n })\n return cb ? p.then(cb, cb) : p\n}\n\nconst extractSync = opt => new Unpack.Sync(opt)\n\nconst extract = opt => new Unpack(opt)\n","// Get the appropriate flag to use for creating files\n// We use fmap on Windows platforms for files less than\n// 512kb. This is a fairly low limit, but avoids making\n// things slower in some cases. Since most of what this\n// library is used for is extracting tarballs of many\n// relatively small files in npm packages and the like,\n// it can be a big boost on Windows platforms.\n// Only supported in Node v12.9.0 and above.\nconst platform = process.env.__FAKE_PLATFORM__ || process.platform\nconst isWindows = platform === 'win32'\nconst fs = global.__FAKE_TESTING_FS__ || require('fs')\n\n/* istanbul ignore next */\nconst { O_CREAT, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP = 0 } = fs.constants\n\nconst fMapEnabled = isWindows && !!UV_FS_O_FILEMAP\nconst fMapLimit = 512 * 1024\nconst fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY\nmodule.exports = !fMapEnabled ? () => 'w'\n : size => size < fMapLimit ? fMapFlag : 'w'\n","'use strict'\n// parse a 512-byte header block to a data object, or vice-versa\n// encode returns `true` if a pax extended header is needed, because\n// the data could not be faithfully encoded in a simple header.\n// (Also, check header.needPax to see if it needs a pax header.)\n\nconst types = require('./types.js')\nconst pathModule = require('path').posix\nconst large = require('./large-numbers.js')\n\nconst SLURP = Symbol('slurp')\nconst TYPE = Symbol('type')\n\nclass Header {\n constructor (data, off, ex, gex) {\n this.cksumValid = false\n this.needPax = false\n this.nullBlock = false\n\n this.block = null\n this.path = null\n this.mode = null\n this.uid = null\n this.gid = null\n this.size = null\n this.mtime = null\n this.cksum = null\n this[TYPE] = '0'\n this.linkpath = null\n this.uname = null\n this.gname = null\n this.devmaj = 0\n this.devmin = 0\n this.atime = null\n this.ctime = null\n\n if (Buffer.isBuffer(data))\n this.decode(data, off || 0, ex, gex)\n else if (data)\n this.set(data)\n }\n\n decode (buf, off, ex, gex) {\n if (!off)\n off = 0\n\n if (!buf || !(buf.length >= off + 512))\n throw new Error('need 512 bytes for header')\n\n this.path = decString(buf, off, 100)\n this.mode = decNumber(buf, off + 100, 8)\n this.uid = decNumber(buf, off + 108, 8)\n this.gid = decNumber(buf, off + 116, 8)\n this.size = decNumber(buf, off + 124, 12)\n this.mtime = decDate(buf, off + 136, 12)\n this.cksum = decNumber(buf, off + 148, 12)\n\n // if we have extended or global extended headers, apply them now\n // See https://github.com/npm/node-tar/pull/187\n this[SLURP](ex)\n this[SLURP](gex, true)\n\n // old tar versions marked dirs as a file with a trailing /\n this[TYPE] = decString(buf, off + 156, 1)\n if (this[TYPE] === '')\n this[TYPE] = '0'\n if (this[TYPE] === '0' && this.path.substr(-1) === '/')\n this[TYPE] = '5'\n\n // tar implementations sometimes incorrectly put the stat(dir).size\n // as the size in the tarball, even though Directory entries are\n // not able to have any body at all. In the very rare chance that\n // it actually DOES have a body, we weren't going to do anything with\n // it anyway, and it'll just be a warning about an invalid header.\n if (this[TYPE] === '5')\n this.size = 0\n\n this.linkpath = decString(buf, off + 157, 100)\n if (buf.slice(off + 257, off + 265).toString() === 'ustar\\u000000') {\n this.uname = decString(buf, off + 265, 32)\n this.gname = decString(buf, off + 297, 32)\n this.devmaj = decNumber(buf, off + 329, 8)\n this.devmin = decNumber(buf, off + 337, 8)\n if (buf[off + 475] !== 0) {\n // definitely a prefix, definitely >130 chars.\n const prefix = decString(buf, off + 345, 155)\n this.path = prefix + '/' + this.path\n } else {\n const prefix = decString(buf, off + 345, 130)\n if (prefix)\n this.path = prefix + '/' + this.path\n this.atime = decDate(buf, off + 476, 12)\n this.ctime = decDate(buf, off + 488, 12)\n }\n }\n\n let sum = 8 * 0x20\n for (let i = off; i < off + 148; i++)\n sum += buf[i]\n\n for (let i = off + 156; i < off + 512; i++)\n sum += buf[i]\n\n this.cksumValid = sum === this.cksum\n if (this.cksum === null && sum === 8 * 0x20)\n this.nullBlock = true\n }\n\n [SLURP] (ex, global) {\n for (const k in ex) {\n // we slurp in everything except for the path attribute in\n // a global extended header, because that's weird.\n if (ex[k] !== null && ex[k] !== undefined &&\n !(global && k === 'path'))\n this[k] = ex[k]\n }\n }\n\n encode (buf, off) {\n if (!buf) {\n buf = this.block = Buffer.alloc(512)\n off = 0\n }\n\n if (!off)\n off = 0\n\n if (!(buf.length >= off + 512))\n throw new Error('need 512 bytes for header')\n\n const prefixSize = this.ctime || this.atime ? 130 : 155\n const split = splitPrefix(this.path || '', prefixSize)\n const path = split[0]\n const prefix = split[1]\n this.needPax = split[2]\n\n this.needPax = encString(buf, off, 100, path) || this.needPax\n this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax\n this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax\n this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax\n this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax\n this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax\n buf[off + 156] = this[TYPE].charCodeAt(0)\n this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax\n buf.write('ustar\\u000000', off + 257, 8)\n this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax\n this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax\n this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax\n this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax\n this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax\n if (buf[off + 475] !== 0)\n this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax\n else {\n this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax\n this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax\n this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax\n }\n\n let sum = 8 * 0x20\n for (let i = off; i < off + 148; i++)\n sum += buf[i]\n\n for (let i = off + 156; i < off + 512; i++)\n sum += buf[i]\n\n this.cksum = sum\n encNumber(buf, off + 148, 8, this.cksum)\n this.cksumValid = true\n\n return this.needPax\n }\n\n set (data) {\n for (const i in data) {\n if (data[i] !== null && data[i] !== undefined)\n this[i] = data[i]\n }\n }\n\n get type () {\n return types.name.get(this[TYPE]) || this[TYPE]\n }\n\n get typeKey () {\n return this[TYPE]\n }\n\n set type (type) {\n if (types.code.has(type))\n this[TYPE] = types.code.get(type)\n else\n this[TYPE] = type\n }\n}\n\nconst splitPrefix = (p, prefixSize) => {\n const pathSize = 100\n let pp = p\n let prefix = ''\n let ret\n const root = pathModule.parse(p).root || '.'\n\n if (Buffer.byteLength(pp) < pathSize)\n ret = [pp, prefix, false]\n else {\n // first set prefix to the dir, and path to the base\n prefix = pathModule.dirname(pp)\n pp = pathModule.basename(pp)\n\n do {\n // both fit!\n if (Buffer.byteLength(pp) <= pathSize &&\n Buffer.byteLength(prefix) <= prefixSize)\n ret = [pp, prefix, false]\n\n // prefix fits in prefix, but path doesn't fit in path\n else if (Buffer.byteLength(pp) > pathSize &&\n Buffer.byteLength(prefix) <= prefixSize)\n ret = [pp.substr(0, pathSize - 1), prefix, true]\n\n else {\n // make path take a bit from prefix\n pp = pathModule.join(pathModule.basename(prefix), pp)\n prefix = pathModule.dirname(prefix)\n }\n } while (prefix !== root && !ret)\n\n // at this point, found no resolution, just truncate\n if (!ret)\n ret = [p.substr(0, pathSize - 1), '', true]\n }\n return ret\n}\n\nconst decString = (buf, off, size) =>\n buf.slice(off, off + size).toString('utf8').replace(/\\0.*/, '')\n\nconst decDate = (buf, off, size) =>\n numToDate(decNumber(buf, off, size))\n\nconst numToDate = num => num === null ? null : new Date(num * 1000)\n\nconst decNumber = (buf, off, size) =>\n buf[off] & 0x80 ? large.parse(buf.slice(off, off + size))\n : decSmallNumber(buf, off, size)\n\nconst nanNull = value => isNaN(value) ? null : value\n\nconst decSmallNumber = (buf, off, size) =>\n nanNull(parseInt(\n buf.slice(off, off + size)\n .toString('utf8').replace(/\\0.*$/, '').trim(), 8))\n\n// the maximum encodable as a null-terminated octal, by field size\nconst MAXNUM = {\n 12: 0o77777777777,\n 8: 0o7777777,\n}\n\nconst encNumber = (buf, off, size, number) =>\n number === null ? false :\n number > MAXNUM[size] || number < 0\n ? (large.encode(number, buf.slice(off, off + size)), true)\n : (encSmallNumber(buf, off, size, number), false)\n\nconst encSmallNumber = (buf, off, size, number) =>\n buf.write(octalString(number, size), off, size, 'ascii')\n\nconst octalString = (number, size) =>\n padOctal(Math.floor(number).toString(8), size)\n\nconst padOctal = (string, size) =>\n (string.length === size - 1 ? string\n : new Array(size - string.length - 1).join('0') + string + ' ') + '\\0'\n\nconst encDate = (buf, off, size, date) =>\n date === null ? false :\n encNumber(buf, off, size, date.getTime() / 1000)\n\n// enough to fill the longest string we've got\nconst NULLS = new Array(156).join('\\0')\n// pad with nulls, return true if it's longer or non-ascii\nconst encString = (buf, off, size, string) =>\n string === null ? false :\n (buf.write(string + NULLS, off, size, 'utf8'),\n string.length !== Buffer.byteLength(string) || string.length > size)\n\nmodule.exports = Header\n","'use strict'\n\n// turn tar(1) style args like `C` into the more verbose things like `cwd`\n\nconst argmap = new Map([\n ['C', 'cwd'],\n ['f', 'file'],\n ['z', 'gzip'],\n ['P', 'preservePaths'],\n ['U', 'unlink'],\n ['strip-components', 'strip'],\n ['stripComponents', 'strip'],\n ['keep-newer', 'newer'],\n ['keepNewer', 'newer'],\n ['keep-newer-files', 'newer'],\n ['keepNewerFiles', 'newer'],\n ['k', 'keep'],\n ['keep-existing', 'keep'],\n ['keepExisting', 'keep'],\n ['m', 'noMtime'],\n ['no-mtime', 'noMtime'],\n ['p', 'preserveOwner'],\n ['L', 'follow'],\n ['h', 'follow'],\n])\n\nmodule.exports = opt => opt ? Object.keys(opt).map(k => [\n argmap.has(k) ? argmap.get(k) : k, opt[k],\n]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {}\n","'use strict'\n// Tar can encode large and negative numbers using a leading byte of\n// 0xff for negative, and 0x80 for positive.\n\nconst encode = (num, buf) => {\n if (!Number.isSafeInteger(num))\n // The number is so large that javascript cannot represent it with integer\n // precision.\n throw Error('cannot encode number outside of javascript safe integer range')\n else if (num < 0)\n encodeNegative(num, buf)\n else\n encodePositive(num, buf)\n return buf\n}\n\nconst encodePositive = (num, buf) => {\n buf[0] = 0x80\n\n for (var i = buf.length; i > 1; i--) {\n buf[i - 1] = num & 0xff\n num = Math.floor(num / 0x100)\n }\n}\n\nconst encodeNegative = (num, buf) => {\n buf[0] = 0xff\n var flipped = false\n num = num * -1\n for (var i = buf.length; i > 1; i--) {\n var byte = num & 0xff\n num = Math.floor(num / 0x100)\n if (flipped)\n buf[i - 1] = onesComp(byte)\n else if (byte === 0)\n buf[i - 1] = 0\n else {\n flipped = true\n buf[i - 1] = twosComp(byte)\n }\n }\n}\n\nconst parse = (buf) => {\n const pre = buf[0]\n const value = pre === 0x80 ? pos(buf.slice(1, buf.length))\n : pre === 0xff ? twos(buf)\n : null\n if (value === null)\n throw Error('invalid base256 encoding')\n\n if (!Number.isSafeInteger(value))\n // The number is so large that javascript cannot represent it with integer\n // precision.\n throw Error('parsed number outside of javascript safe integer range')\n\n return value\n}\n\nconst twos = (buf) => {\n var len = buf.length\n var sum = 0\n var flipped = false\n for (var i = len - 1; i > -1; i--) {\n var byte = buf[i]\n var f\n if (flipped)\n f = onesComp(byte)\n else if (byte === 0)\n f = byte\n else {\n flipped = true\n f = twosComp(byte)\n }\n if (f !== 0)\n sum -= f * Math.pow(256, len - i - 1)\n }\n return sum\n}\n\nconst pos = (buf) => {\n var len = buf.length\n var sum = 0\n for (var i = len - 1; i > -1; i--) {\n var byte = buf[i]\n if (byte !== 0)\n sum += byte * Math.pow(256, len - i - 1)\n }\n return sum\n}\n\nconst onesComp = byte => (0xff ^ byte) & 0xff\n\nconst twosComp = byte => ((0xff ^ byte) + 1) & 0xff\n\nmodule.exports = {\n encode,\n parse,\n}\n","'use strict'\n\n// XXX: This shares a lot in common with extract.js\n// maybe some DRY opportunity here?\n\n// tar -t\nconst hlo = require('./high-level-opt.js')\nconst Parser = require('./parse.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst path = require('path')\n\nmodule.exports = (opt_, files, cb) => {\n if (typeof opt_ === 'function')\n cb = opt_, files = null, opt_ = {}\n else if (Array.isArray(opt_))\n files = opt_, opt_ = {}\n\n if (typeof files === 'function')\n cb = files, files = null\n\n if (!files)\n files = []\n else\n files = Array.from(files)\n\n const opt = hlo(opt_)\n\n if (opt.sync && typeof cb === 'function')\n throw new TypeError('callback not supported for sync tar functions')\n\n if (!opt.file && typeof cb === 'function')\n throw new TypeError('callback only supported with file option')\n\n if (files.length)\n filesFilter(opt, files)\n\n if (!opt.noResume)\n onentryFunction(opt)\n\n return opt.file && opt.sync ? listFileSync(opt)\n : opt.file ? listFile(opt, cb)\n : list(opt)\n}\n\nconst onentryFunction = opt => {\n const onentry = opt.onentry\n opt.onentry = onentry ? e => {\n onentry(e)\n e.resume()\n } : e => e.resume()\n}\n\n// construct a filter that limits the file entries listed\n// include child entries if a dir is included\nconst filesFilter = (opt, files) => {\n const map = new Map(files.map(f => [f.replace(/\\/+$/, ''), true]))\n const filter = opt.filter\n\n const mapHas = (file, r) => {\n const root = r || path.parse(file).root || '.'\n const ret = file === root ? false\n : map.has(file) ? map.get(file)\n : mapHas(path.dirname(file), root)\n\n map.set(file, ret)\n return ret\n }\n\n opt.filter = filter\n ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\\/+$/, ''))\n : file => mapHas(file.replace(/\\/+$/, ''))\n}\n\nconst listFileSync = opt => {\n const p = list(opt)\n const file = opt.file\n let threw = true\n let fd\n try {\n const stat = fs.statSync(file)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n if (stat.size < readSize)\n p.end(fs.readFileSync(file))\n else {\n let pos = 0\n const buf = Buffer.allocUnsafe(readSize)\n fd = fs.openSync(file, 'r')\n while (pos < stat.size) {\n const bytesRead = fs.readSync(fd, buf, 0, readSize, pos)\n pos += bytesRead\n p.write(buf.slice(0, bytesRead))\n }\n p.end()\n }\n threw = false\n } finally {\n if (threw && fd) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n }\n }\n}\n\nconst listFile = (opt, cb) => {\n const parse = new Parser(opt)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n\n const file = opt.file\n const p = new Promise((resolve, reject) => {\n parse.on('error', reject)\n parse.on('end', resolve)\n\n fs.stat(file, (er, stat) => {\n if (er)\n reject(er)\n else {\n const stream = new fsm.ReadStream(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.on('error', reject)\n stream.pipe(parse)\n }\n })\n })\n return cb ? p.then(cb, cb) : p\n}\n\nconst list = opt => new Parser(opt)\n","'use strict'\n// wrapper around mkdirp for tar's needs.\n\n// TODO: This should probably be a class, not functionally\n// passing around state in a gazillion args.\n\nconst mkdirp = require('mkdirp')\nconst fs = require('fs')\nconst path = require('path')\nconst chownr = require('chownr')\n\nclass SymlinkError extends Error {\n constructor (symlink, path) {\n super('Cannot extract through symbolic link')\n this.path = path\n this.symlink = symlink\n }\n\n get name () {\n return 'SylinkError'\n }\n}\n\nclass CwdError extends Error {\n constructor (path, code) {\n super(code + ': Cannot cd into \\'' + path + '\\'')\n this.path = path\n this.code = code\n }\n\n get name () {\n return 'CwdError'\n }\n}\n\nmodule.exports = (dir, opt, cb) => {\n // if there's any overlap between mask and mode,\n // then we'll need an explicit chmod\n const umask = opt.umask\n const mode = opt.mode | 0o0700\n const needChmod = (mode & umask) !== 0\n\n const uid = opt.uid\n const gid = opt.gid\n const doChown = typeof uid === 'number' &&\n typeof gid === 'number' &&\n (uid !== opt.processUid || gid !== opt.processGid)\n\n const preserve = opt.preserve\n const unlink = opt.unlink\n const cache = opt.cache\n const cwd = opt.cwd\n\n const done = (er, created) => {\n if (er)\n cb(er)\n else {\n cache.set(dir, true)\n if (created && doChown)\n chownr(created, uid, gid, er => done(er))\n else if (needChmod)\n fs.chmod(dir, mode, cb)\n else\n cb()\n }\n }\n\n if (cache && cache.get(dir) === true)\n return done()\n\n if (dir === cwd) {\n return fs.stat(dir, (er, st) => {\n if (er || !st.isDirectory())\n er = new CwdError(dir, er && er.code || 'ENOTDIR')\n done(er)\n })\n }\n\n if (preserve)\n return mkdirp(dir, {mode}).then(made => done(null, made), done)\n\n const sub = path.relative(cwd, dir)\n const parts = sub.split(/\\/|\\\\/)\n mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done)\n}\n\nconst mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => {\n if (!parts.length)\n return cb(null, created)\n const p = parts.shift()\n const part = base + '/' + p\n if (cache.get(part))\n return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)\n fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))\n}\n\nconst onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => {\n if (er) {\n if (er.path && path.dirname(er.path) === cwd &&\n (er.code === 'ENOTDIR' || er.code === 'ENOENT'))\n return cb(new CwdError(cwd, er.code))\n\n fs.lstat(part, (statEr, st) => {\n if (statEr)\n cb(statEr)\n else if (st.isDirectory())\n mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)\n else if (unlink) {\n fs.unlink(part, er => {\n if (er)\n return cb(er)\n fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))\n })\n } else if (st.isSymbolicLink())\n return cb(new SymlinkError(part, part + '/' + parts.join('/')))\n else\n cb(er)\n })\n } else {\n created = created || part\n mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)\n }\n}\n\nmodule.exports.sync = (dir, opt) => {\n // if there's any overlap between mask and mode,\n // then we'll need an explicit chmod\n const umask = opt.umask\n const mode = opt.mode | 0o0700\n const needChmod = (mode & umask) !== 0\n\n const uid = opt.uid\n const gid = opt.gid\n const doChown = typeof uid === 'number' &&\n typeof gid === 'number' &&\n (uid !== opt.processUid || gid !== opt.processGid)\n\n const preserve = opt.preserve\n const unlink = opt.unlink\n const cache = opt.cache\n const cwd = opt.cwd\n\n const done = (created) => {\n cache.set(dir, true)\n if (created && doChown)\n chownr.sync(created, uid, gid)\n if (needChmod)\n fs.chmodSync(dir, mode)\n }\n\n if (cache && cache.get(dir) === true)\n return done()\n\n if (dir === cwd) {\n let ok = false\n let code = 'ENOTDIR'\n try {\n ok = fs.statSync(dir).isDirectory()\n } catch (er) {\n code = er.code\n } finally {\n if (!ok)\n throw new CwdError(dir, code)\n }\n done()\n return\n }\n\n if (preserve)\n return done(mkdirp.sync(dir, mode))\n\n const sub = path.relative(cwd, dir)\n const parts = sub.split(/\\/|\\\\/)\n let created = null\n for (let p = parts.shift(), part = cwd;\n p && (part += '/' + p);\n p = parts.shift()) {\n if (cache.get(part))\n continue\n\n try {\n fs.mkdirSync(part, mode)\n created = created || part\n cache.set(part, true)\n } catch (er) {\n if (er.path && path.dirname(er.path) === cwd &&\n (er.code === 'ENOTDIR' || er.code === 'ENOENT'))\n return new CwdError(cwd, er.code)\n\n const st = fs.lstatSync(part)\n if (st.isDirectory()) {\n cache.set(part, true)\n continue\n } else if (unlink) {\n fs.unlinkSync(part)\n fs.mkdirSync(part, mode)\n created = created || part\n cache.set(part, true)\n continue\n } else if (st.isSymbolicLink())\n return new SymlinkError(part, part + '/' + parts.join('/'))\n }\n }\n\n return done(created)\n}\n","'use strict'\nmodule.exports = (mode, isDir, portable) => {\n mode &= 0o7777\n\n // in portable mode, use the minimum reasonable umask\n // if this system creates files with 0o664 by default\n // (as some linux distros do), then we'll write the\n // archive with 0o644 instead. Also, don't ever create\n // a file that is not readable/writable by the owner.\n if (portable)\n mode = (mode | 0o600) & ~0o22\n\n // if dirs are readable, then they should be listable\n if (isDir) {\n if (mode & 0o400)\n mode |= 0o100\n if (mode & 0o40)\n mode |= 0o10\n if (mode & 0o4)\n mode |= 0o1\n }\n return mode\n}\n","'use strict'\n\n// A readable tar stream creator\n// Technically, this is a transform stream that you write paths into,\n// and tar format comes out of.\n// The `add()` method is like `write()` but returns this,\n// and end() return `this` as well, so you can\n// do `new Pack(opt).add('files').add('dir').end().pipe(output)\n// You could also do something like:\n// streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar'))\n\nclass PackJob {\n constructor (path, absolute) {\n this.path = path || './'\n this.absolute = absolute\n this.entry = null\n this.stat = null\n this.readdir = null\n this.pending = false\n this.ignore = false\n this.piped = false\n }\n}\n\nconst MiniPass = require('minipass')\nconst zlib = require('minizlib')\nconst ReadEntry = require('./read-entry.js')\nconst WriteEntry = require('./write-entry.js')\nconst WriteEntrySync = WriteEntry.Sync\nconst WriteEntryTar = WriteEntry.Tar\nconst Yallist = require('yallist')\nconst EOF = Buffer.alloc(1024)\nconst ONSTAT = Symbol('onStat')\nconst ENDED = Symbol('ended')\nconst QUEUE = Symbol('queue')\nconst CURRENT = Symbol('current')\nconst PROCESS = Symbol('process')\nconst PROCESSING = Symbol('processing')\nconst PROCESSJOB = Symbol('processJob')\nconst JOBS = Symbol('jobs')\nconst JOBDONE = Symbol('jobDone')\nconst ADDFSENTRY = Symbol('addFSEntry')\nconst ADDTARENTRY = Symbol('addTarEntry')\nconst STAT = Symbol('stat')\nconst READDIR = Symbol('readdir')\nconst ONREADDIR = Symbol('onreaddir')\nconst PIPE = Symbol('pipe')\nconst ENTRY = Symbol('entry')\nconst ENTRYOPT = Symbol('entryOpt')\nconst WRITEENTRYCLASS = Symbol('writeEntryClass')\nconst WRITE = Symbol('write')\nconst ONDRAIN = Symbol('ondrain')\n\nconst fs = require('fs')\nconst path = require('path')\nconst warner = require('./warn-mixin.js')\n\nconst Pack = warner(class Pack extends MiniPass {\n constructor (opt) {\n super(opt)\n opt = opt || Object.create(null)\n this.opt = opt\n this.file = opt.file || ''\n this.cwd = opt.cwd || process.cwd()\n this.maxReadSize = opt.maxReadSize\n this.preservePaths = !!opt.preservePaths\n this.strict = !!opt.strict\n this.noPax = !!opt.noPax\n this.prefix = (opt.prefix || '').replace(/(\\\\|\\/)+$/, '')\n this.linkCache = opt.linkCache || new Map()\n this.statCache = opt.statCache || new Map()\n this.readdirCache = opt.readdirCache || new Map()\n\n this[WRITEENTRYCLASS] = WriteEntry\n if (typeof opt.onwarn === 'function')\n this.on('warn', opt.onwarn)\n\n this.portable = !!opt.portable\n this.zip = null\n if (opt.gzip) {\n if (typeof opt.gzip !== 'object')\n opt.gzip = {}\n if (this.portable)\n opt.gzip.portable = true\n this.zip = new zlib.Gzip(opt.gzip)\n this.zip.on('data', chunk => super.write(chunk))\n this.zip.on('end', _ => super.end())\n this.zip.on('drain', _ => this[ONDRAIN]())\n this.on('resume', _ => this.zip.resume())\n } else\n this.on('drain', this[ONDRAIN])\n\n this.noDirRecurse = !!opt.noDirRecurse\n this.follow = !!opt.follow\n this.noMtime = !!opt.noMtime\n this.mtime = opt.mtime || null\n\n this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true\n\n this[QUEUE] = new Yallist()\n this[JOBS] = 0\n this.jobs = +opt.jobs || 4\n this[PROCESSING] = false\n this[ENDED] = false\n }\n\n [WRITE] (chunk) {\n return super.write(chunk)\n }\n\n add (path) {\n this.write(path)\n return this\n }\n\n end (path) {\n if (path)\n this.write(path)\n this[ENDED] = true\n this[PROCESS]()\n return this\n }\n\n write (path) {\n if (this[ENDED])\n throw new Error('write after end')\n\n if (path instanceof ReadEntry)\n this[ADDTARENTRY](path)\n else\n this[ADDFSENTRY](path)\n return this.flowing\n }\n\n [ADDTARENTRY] (p) {\n const absolute = path.resolve(this.cwd, p.path)\n if (this.prefix)\n p.path = this.prefix + '/' + p.path.replace(/^\\.(\\/+|$)/, '')\n\n // in this case, we don't have to wait for the stat\n if (!this.filter(p.path, p))\n p.resume()\n else {\n const job = new PackJob(p.path, absolute, false)\n job.entry = new WriteEntryTar(p, this[ENTRYOPT](job))\n job.entry.on('end', _ => this[JOBDONE](job))\n this[JOBS] += 1\n this[QUEUE].push(job)\n }\n\n this[PROCESS]()\n }\n\n [ADDFSENTRY] (p) {\n const absolute = path.resolve(this.cwd, p)\n if (this.prefix)\n p = this.prefix + '/' + p.replace(/^\\.(\\/+|$)/, '')\n\n this[QUEUE].push(new PackJob(p, absolute))\n this[PROCESS]()\n }\n\n [STAT] (job) {\n job.pending = true\n this[JOBS] += 1\n const stat = this.follow ? 'stat' : 'lstat'\n fs[stat](job.absolute, (er, stat) => {\n job.pending = false\n this[JOBS] -= 1\n if (er)\n this.emit('error', er)\n else\n this[ONSTAT](job, stat)\n })\n }\n\n [ONSTAT] (job, stat) {\n this.statCache.set(job.absolute, stat)\n job.stat = stat\n\n // now we have the stat, we can filter it.\n if (!this.filter(job.path, stat))\n job.ignore = true\n\n this[PROCESS]()\n }\n\n [READDIR] (job) {\n job.pending = true\n this[JOBS] += 1\n fs.readdir(job.absolute, (er, entries) => {\n job.pending = false\n this[JOBS] -= 1\n if (er)\n return this.emit('error', er)\n this[ONREADDIR](job, entries)\n })\n }\n\n [ONREADDIR] (job, entries) {\n this.readdirCache.set(job.absolute, entries)\n job.readdir = entries\n this[PROCESS]()\n }\n\n [PROCESS] () {\n if (this[PROCESSING])\n return\n\n this[PROCESSING] = true\n for (let w = this[QUEUE].head;\n w !== null && this[JOBS] < this.jobs;\n w = w.next) {\n this[PROCESSJOB](w.value)\n if (w.value.ignore) {\n const p = w.next\n this[QUEUE].removeNode(w)\n w.next = p\n }\n }\n\n this[PROCESSING] = false\n\n if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) {\n if (this.zip)\n this.zip.end(EOF)\n else {\n super.write(EOF)\n super.end()\n }\n }\n }\n\n get [CURRENT] () {\n return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value\n }\n\n [JOBDONE] (job) {\n this[QUEUE].shift()\n this[JOBS] -= 1\n this[PROCESS]()\n }\n\n [PROCESSJOB] (job) {\n if (job.pending)\n return\n\n if (job.entry) {\n if (job === this[CURRENT] && !job.piped)\n this[PIPE](job)\n return\n }\n\n if (!job.stat) {\n if (this.statCache.has(job.absolute))\n this[ONSTAT](job, this.statCache.get(job.absolute))\n else\n this[STAT](job)\n }\n if (!job.stat)\n return\n\n // filtered out!\n if (job.ignore)\n return\n\n if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) {\n if (this.readdirCache.has(job.absolute))\n this[ONREADDIR](job, this.readdirCache.get(job.absolute))\n else\n this[READDIR](job)\n if (!job.readdir)\n return\n }\n\n // we know it doesn't have an entry, because that got checked above\n job.entry = this[ENTRY](job)\n if (!job.entry) {\n job.ignore = true\n return\n }\n\n if (job === this[CURRENT] && !job.piped)\n this[PIPE](job)\n }\n\n [ENTRYOPT] (job) {\n return {\n onwarn: (code, msg, data) => this.warn(code, msg, data),\n noPax: this.noPax,\n cwd: this.cwd,\n absolute: job.absolute,\n preservePaths: this.preservePaths,\n maxReadSize: this.maxReadSize,\n strict: this.strict,\n portable: this.portable,\n linkCache: this.linkCache,\n statCache: this.statCache,\n noMtime: this.noMtime,\n mtime: this.mtime,\n }\n }\n\n [ENTRY] (job) {\n this[JOBS] += 1\n try {\n return new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job))\n .on('end', () => this[JOBDONE](job))\n .on('error', er => this.emit('error', er))\n } catch (er) {\n this.emit('error', er)\n }\n }\n\n [ONDRAIN] () {\n if (this[CURRENT] && this[CURRENT].entry)\n this[CURRENT].entry.resume()\n }\n\n // like .pipe() but using super, because our write() is special\n [PIPE] (job) {\n job.piped = true\n\n if (job.readdir) {\n job.readdir.forEach(entry => {\n const p = this.prefix ?\n job.path.slice(this.prefix.length + 1) || './'\n : job.path\n\n const base = p === './' ? '' : p.replace(/\\/*$/, '/')\n this[ADDFSENTRY](base + entry)\n })\n }\n\n const source = job.entry\n const zip = this.zip\n\n if (zip) {\n source.on('data', chunk => {\n if (!zip.write(chunk))\n source.pause()\n })\n } else {\n source.on('data', chunk => {\n if (!super.write(chunk))\n source.pause()\n })\n }\n }\n\n pause () {\n if (this.zip)\n this.zip.pause()\n return super.pause()\n }\n})\n\nclass PackSync extends Pack {\n constructor (opt) {\n super(opt)\n this[WRITEENTRYCLASS] = WriteEntrySync\n }\n\n // pause/resume are no-ops in sync streams.\n pause () {}\n resume () {}\n\n [STAT] (job) {\n const stat = this.follow ? 'statSync' : 'lstatSync'\n this[ONSTAT](job, fs[stat](job.absolute))\n }\n\n [READDIR] (job, stat) {\n this[ONREADDIR](job, fs.readdirSync(job.absolute))\n }\n\n // gotta get it all in this tick\n [PIPE] (job) {\n const source = job.entry\n const zip = this.zip\n\n if (job.readdir) {\n job.readdir.forEach(entry => {\n const p = this.prefix ?\n job.path.slice(this.prefix.length + 1) || './'\n : job.path\n\n const base = p === './' ? '' : p.replace(/\\/*$/, '/')\n this[ADDFSENTRY](base + entry)\n })\n }\n\n if (zip) {\n source.on('data', chunk => {\n zip.write(chunk)\n })\n } else {\n source.on('data', chunk => {\n super[WRITE](chunk)\n })\n }\n }\n}\n\nPack.Sync = PackSync\n\nmodule.exports = Pack\n","'use strict'\n\n// this[BUFFER] is the remainder of a chunk if we're waiting for\n// the full 512 bytes of a header to come in. We will Buffer.concat()\n// it to the next write(), which is a mem copy, but a small one.\n//\n// this[QUEUE] is a Yallist of entries that haven't been emitted\n// yet this can only get filled up if the user keeps write()ing after\n// a write() returns false, or does a write() with more than one entry\n//\n// We don't buffer chunks, we always parse them and either create an\n// entry, or push it into the active entry. The ReadEntry class knows\n// to throw data away if .ignore=true\n//\n// Shift entry off the buffer when it emits 'end', and emit 'entry' for\n// the next one in the list.\n//\n// At any time, we're pushing body chunks into the entry at WRITEENTRY,\n// and waiting for 'end' on the entry at READENTRY\n//\n// ignored entries get .resume() called on them straight away\n\nconst warner = require('./warn-mixin.js')\nconst Header = require('./header.js')\nconst EE = require('events')\nconst Yallist = require('yallist')\nconst maxMetaEntrySize = 1024 * 1024\nconst Entry = require('./read-entry.js')\nconst Pax = require('./pax.js')\nconst zlib = require('minizlib')\n\nconst gzipHeader = Buffer.from([0x1f, 0x8b])\nconst STATE = Symbol('state')\nconst WRITEENTRY = Symbol('writeEntry')\nconst READENTRY = Symbol('readEntry')\nconst NEXTENTRY = Symbol('nextEntry')\nconst PROCESSENTRY = Symbol('processEntry')\nconst EX = Symbol('extendedHeader')\nconst GEX = Symbol('globalExtendedHeader')\nconst META = Symbol('meta')\nconst EMITMETA = Symbol('emitMeta')\nconst BUFFER = Symbol('buffer')\nconst QUEUE = Symbol('queue')\nconst ENDED = Symbol('ended')\nconst EMITTEDEND = Symbol('emittedEnd')\nconst EMIT = Symbol('emit')\nconst UNZIP = Symbol('unzip')\nconst CONSUMECHUNK = Symbol('consumeChunk')\nconst CONSUMECHUNKSUB = Symbol('consumeChunkSub')\nconst CONSUMEBODY = Symbol('consumeBody')\nconst CONSUMEMETA = Symbol('consumeMeta')\nconst CONSUMEHEADER = Symbol('consumeHeader')\nconst CONSUMING = Symbol('consuming')\nconst BUFFERCONCAT = Symbol('bufferConcat')\nconst MAYBEEND = Symbol('maybeEnd')\nconst WRITING = Symbol('writing')\nconst ABORTED = Symbol('aborted')\nconst DONE = Symbol('onDone')\nconst SAW_VALID_ENTRY = Symbol('sawValidEntry')\nconst SAW_NULL_BLOCK = Symbol('sawNullBlock')\nconst SAW_EOF = Symbol('sawEOF')\n\nconst noop = _ => true\n\nmodule.exports = warner(class Parser extends EE {\n constructor (opt) {\n opt = opt || {}\n super(opt)\n\n this.file = opt.file || ''\n\n // set to boolean false when an entry starts. 1024 bytes of \\0\n // is technically a valid tarball, albeit a boring one.\n this[SAW_VALID_ENTRY] = null\n\n // these BADARCHIVE errors can't be detected early. listen on DONE.\n this.on(DONE, _ => {\n if (this[STATE] === 'begin' || this[SAW_VALID_ENTRY] === false) {\n // either less than 1 block of data, or all entries were invalid.\n // Either way, probably not even a tarball.\n this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format')\n }\n })\n\n if (opt.ondone)\n this.on(DONE, opt.ondone)\n else {\n this.on(DONE, _ => {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n this.emit('close')\n })\n }\n\n this.strict = !!opt.strict\n this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize\n this.filter = typeof opt.filter === 'function' ? opt.filter : noop\n\n // have to set this so that streams are ok piping into it\n this.writable = true\n this.readable = false\n\n this[QUEUE] = new Yallist()\n this[BUFFER] = null\n this[READENTRY] = null\n this[WRITEENTRY] = null\n this[STATE] = 'begin'\n this[META] = ''\n this[EX] = null\n this[GEX] = null\n this[ENDED] = false\n this[UNZIP] = null\n this[ABORTED] = false\n this[SAW_NULL_BLOCK] = false\n this[SAW_EOF] = false\n if (typeof opt.onwarn === 'function')\n this.on('warn', opt.onwarn)\n if (typeof opt.onentry === 'function')\n this.on('entry', opt.onentry)\n }\n\n [CONSUMEHEADER] (chunk, position) {\n if (this[SAW_VALID_ENTRY] === null)\n this[SAW_VALID_ENTRY] = false\n let header\n try {\n header = new Header(chunk, position, this[EX], this[GEX])\n } catch (er) {\n return this.warn('TAR_ENTRY_INVALID', er)\n }\n\n if (header.nullBlock) {\n if (this[SAW_NULL_BLOCK]) {\n this[SAW_EOF] = true\n // ending an archive with no entries. pointless, but legal.\n if (this[STATE] === 'begin')\n this[STATE] = 'header'\n this[EMIT]('eof')\n } else {\n this[SAW_NULL_BLOCK] = true\n this[EMIT]('nullBlock')\n }\n } else {\n this[SAW_NULL_BLOCK] = false\n if (!header.cksumValid)\n this.warn('TAR_ENTRY_INVALID', 'checksum failure', {header})\n else if (!header.path)\n this.warn('TAR_ENTRY_INVALID', 'path is required', {header})\n else {\n const type = header.type\n if (/^(Symbolic)?Link$/.test(type) && !header.linkpath)\n this.warn('TAR_ENTRY_INVALID', 'linkpath required', {header})\n else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath)\n this.warn('TAR_ENTRY_INVALID', 'linkpath forbidden', {header})\n else {\n const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX])\n\n // we do this for meta & ignored entries as well, because they\n // are still valid tar, or else we wouldn't know to ignore them\n if (!this[SAW_VALID_ENTRY]) {\n if (entry.remain) {\n // this might be the one!\n const onend = () => {\n if (!entry.invalid)\n this[SAW_VALID_ENTRY] = true\n }\n entry.on('end', onend)\n } else\n this[SAW_VALID_ENTRY] = true\n }\n\n if (entry.meta) {\n if (entry.size > this.maxMetaEntrySize) {\n entry.ignore = true\n this[EMIT]('ignoredEntry', entry)\n this[STATE] = 'ignore'\n entry.resume()\n } else if (entry.size > 0) {\n this[META] = ''\n entry.on('data', c => this[META] += c)\n this[STATE] = 'meta'\n }\n } else {\n this[EX] = null\n entry.ignore = entry.ignore || !this.filter(entry.path, entry)\n\n if (entry.ignore) {\n // probably valid, just not something we care about\n this[EMIT]('ignoredEntry', entry)\n this[STATE] = entry.remain ? 'ignore' : 'header'\n entry.resume()\n } else {\n if (entry.remain)\n this[STATE] = 'body'\n else {\n this[STATE] = 'header'\n entry.end()\n }\n\n if (!this[READENTRY]) {\n this[QUEUE].push(entry)\n this[NEXTENTRY]()\n } else\n this[QUEUE].push(entry)\n }\n }\n }\n }\n }\n }\n\n [PROCESSENTRY] (entry) {\n let go = true\n\n if (!entry) {\n this[READENTRY] = null\n go = false\n } else if (Array.isArray(entry))\n this.emit.apply(this, entry)\n else {\n this[READENTRY] = entry\n this.emit('entry', entry)\n if (!entry.emittedEnd) {\n entry.on('end', _ => this[NEXTENTRY]())\n go = false\n }\n }\n\n return go\n }\n\n [NEXTENTRY] () {\n do {} while (this[PROCESSENTRY](this[QUEUE].shift()))\n\n if (!this[QUEUE].length) {\n // At this point, there's nothing in the queue, but we may have an\n // entry which is being consumed (readEntry).\n // If we don't, then we definitely can handle more data.\n // If we do, and either it's flowing, or it has never had any data\n // written to it, then it needs more.\n // The only other possibility is that it has returned false from a\n // write() call, so we wait for the next drain to continue.\n const re = this[READENTRY]\n const drainNow = !re || re.flowing || re.size === re.remain\n if (drainNow) {\n if (!this[WRITING])\n this.emit('drain')\n } else\n re.once('drain', _ => this.emit('drain'))\n }\n }\n\n [CONSUMEBODY] (chunk, position) {\n // write up to but no more than writeEntry.blockRemain\n const entry = this[WRITEENTRY]\n const br = entry.blockRemain\n const c = (br >= chunk.length && position === 0) ? chunk\n : chunk.slice(position, position + br)\n\n entry.write(c)\n\n if (!entry.blockRemain) {\n this[STATE] = 'header'\n this[WRITEENTRY] = null\n entry.end()\n }\n\n return c.length\n }\n\n [CONSUMEMETA] (chunk, position) {\n const entry = this[WRITEENTRY]\n const ret = this[CONSUMEBODY](chunk, position)\n\n // if we finished, then the entry is reset\n if (!this[WRITEENTRY])\n this[EMITMETA](entry)\n\n return ret\n }\n\n [EMIT] (ev, data, extra) {\n if (!this[QUEUE].length && !this[READENTRY])\n this.emit(ev, data, extra)\n else\n this[QUEUE].push([ev, data, extra])\n }\n\n [EMITMETA] (entry) {\n this[EMIT]('meta', this[META])\n switch (entry.type) {\n case 'ExtendedHeader':\n case 'OldExtendedHeader':\n this[EX] = Pax.parse(this[META], this[EX], false)\n break\n\n case 'GlobalExtendedHeader':\n this[GEX] = Pax.parse(this[META], this[GEX], true)\n break\n\n case 'NextFileHasLongPath':\n case 'OldGnuLongPath':\n this[EX] = this[EX] || Object.create(null)\n this[EX].path = this[META].replace(/\\0.*/, '')\n break\n\n case 'NextFileHasLongLinkpath':\n this[EX] = this[EX] || Object.create(null)\n this[EX].linkpath = this[META].replace(/\\0.*/, '')\n break\n\n /* istanbul ignore next */\n default: throw new Error('unknown meta: ' + entry.type)\n }\n }\n\n abort (error) {\n this[ABORTED] = true\n this.emit('abort', error)\n // always throws, even in non-strict mode\n this.warn('TAR_ABORT', error, { recoverable: false })\n }\n\n write (chunk) {\n if (this[ABORTED])\n return\n\n // first write, might be gzipped\n if (this[UNZIP] === null && chunk) {\n if (this[BUFFER]) {\n chunk = Buffer.concat([this[BUFFER], chunk])\n this[BUFFER] = null\n }\n if (chunk.length < gzipHeader.length) {\n this[BUFFER] = chunk\n return true\n }\n for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) {\n if (chunk[i] !== gzipHeader[i])\n this[UNZIP] = false\n }\n if (this[UNZIP] === null) {\n const ended = this[ENDED]\n this[ENDED] = false\n this[UNZIP] = new zlib.Unzip()\n this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk))\n this[UNZIP].on('error', er => this.abort(er))\n this[UNZIP].on('end', _ => {\n this[ENDED] = true\n this[CONSUMECHUNK]()\n })\n this[WRITING] = true\n const ret = this[UNZIP][ended ? 'end' : 'write'](chunk)\n this[WRITING] = false\n return ret\n }\n }\n\n this[WRITING] = true\n if (this[UNZIP])\n this[UNZIP].write(chunk)\n else\n this[CONSUMECHUNK](chunk)\n this[WRITING] = false\n\n // return false if there's a queue, or if the current entry isn't flowing\n const ret =\n this[QUEUE].length ? false :\n this[READENTRY] ? this[READENTRY].flowing :\n true\n\n // if we have no queue, then that means a clogged READENTRY\n if (!ret && !this[QUEUE].length)\n this[READENTRY].once('drain', _ => this.emit('drain'))\n\n return ret\n }\n\n [BUFFERCONCAT] (c) {\n if (c && !this[ABORTED])\n this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c\n }\n\n [MAYBEEND] () {\n if (this[ENDED] &&\n !this[EMITTEDEND] &&\n !this[ABORTED] &&\n !this[CONSUMING]) {\n this[EMITTEDEND] = true\n const entry = this[WRITEENTRY]\n if (entry && entry.blockRemain) {\n // truncated, likely a damaged file\n const have = this[BUFFER] ? this[BUFFER].length : 0\n this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${\n entry.blockRemain} more bytes, only ${have} available)`, {entry})\n if (this[BUFFER])\n entry.write(this[BUFFER])\n entry.end()\n }\n this[EMIT](DONE)\n }\n }\n\n [CONSUMECHUNK] (chunk) {\n if (this[CONSUMING])\n this[BUFFERCONCAT](chunk)\n else if (!chunk && !this[BUFFER])\n this[MAYBEEND]()\n else {\n this[CONSUMING] = true\n if (this[BUFFER]) {\n this[BUFFERCONCAT](chunk)\n const c = this[BUFFER]\n this[BUFFER] = null\n this[CONSUMECHUNKSUB](c)\n } else\n this[CONSUMECHUNKSUB](chunk)\n\n while (this[BUFFER] &&\n this[BUFFER].length >= 512 &&\n !this[ABORTED] &&\n !this[SAW_EOF]) {\n const c = this[BUFFER]\n this[BUFFER] = null\n this[CONSUMECHUNKSUB](c)\n }\n this[CONSUMING] = false\n }\n\n if (!this[BUFFER] || this[ENDED])\n this[MAYBEEND]()\n }\n\n [CONSUMECHUNKSUB] (chunk) {\n // we know that we are in CONSUMING mode, so anything written goes into\n // the buffer. Advance the position and put any remainder in the buffer.\n let position = 0\n const length = chunk.length\n while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) {\n switch (this[STATE]) {\n case 'begin':\n case 'header':\n this[CONSUMEHEADER](chunk, position)\n position += 512\n break\n\n case 'ignore':\n case 'body':\n position += this[CONSUMEBODY](chunk, position)\n break\n\n case 'meta':\n position += this[CONSUMEMETA](chunk, position)\n break\n\n /* istanbul ignore next */\n default:\n throw new Error('invalid state: ' + this[STATE])\n }\n }\n\n if (position < length) {\n if (this[BUFFER])\n this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]])\n else\n this[BUFFER] = chunk.slice(position)\n }\n }\n\n end (chunk) {\n if (!this[ABORTED]) {\n if (this[UNZIP])\n this[UNZIP].end(chunk)\n else {\n this[ENDED] = true\n this.write(chunk)\n }\n }\n }\n})\n","// A path exclusive reservation system\n// reserve([list, of, paths], fn)\n// When the fn is first in line for all its paths, it\n// is called with a cb that clears the reservation.\n//\n// Used by async unpack to avoid clobbering paths in use,\n// while still allowing maximal safe parallelization.\n\nconst assert = require('assert')\n\nmodule.exports = () => {\n // path => [function or Set]\n // A Set object means a directory reservation\n // A fn is a direct reservation on that path\n const queues = new Map()\n\n // fn => {paths:[path,...], dirs:[path, ...]}\n const reservations = new Map()\n\n // return a set of parent dirs for a given path\n const { join } = require('path')\n const getDirs = path =>\n join(path).split(/[\\\\/]/).slice(0, -1).reduce((set, path) =>\n set.length ? set.concat(join(set[set.length - 1], path)) : [path], [])\n\n // functions currently running\n const running = new Set()\n\n // return the queues for each path the function cares about\n // fn => {paths, dirs}\n const getQueues = fn => {\n const res = reservations.get(fn)\n /* istanbul ignore if - unpossible */\n if (!res)\n throw new Error('function does not have any path reservations')\n return {\n paths: res.paths.map(path => queues.get(path)),\n dirs: [...res.dirs].map(path => queues.get(path)),\n }\n }\n\n // check if fn is first in line for all its paths, and is\n // included in the first set for all its dir queues\n const check = fn => {\n const {paths, dirs} = getQueues(fn)\n return paths.every(q => q[0] === fn) &&\n dirs.every(q => q[0] instanceof Set && q[0].has(fn))\n }\n\n // run the function if it's first in line and not already running\n const run = fn => {\n if (running.has(fn) || !check(fn))\n return false\n running.add(fn)\n fn(() => clear(fn))\n return true\n }\n\n const clear = fn => {\n if (!running.has(fn))\n return false\n\n const { paths, dirs } = reservations.get(fn)\n const next = new Set()\n\n paths.forEach(path => {\n const q = queues.get(path)\n assert.equal(q[0], fn)\n if (q.length === 1)\n queues.delete(path)\n else {\n q.shift()\n if (typeof q[0] === 'function')\n next.add(q[0])\n else\n q[0].forEach(fn => next.add(fn))\n }\n })\n\n dirs.forEach(dir => {\n const q = queues.get(dir)\n assert(q[0] instanceof Set)\n if (q[0].size === 1 && q.length === 1)\n queues.delete(dir)\n else if (q[0].size === 1) {\n q.shift()\n\n // must be a function or else the Set would've been reused\n next.add(q[0])\n } else\n q[0].delete(fn)\n })\n running.delete(fn)\n\n next.forEach(fn => run(fn))\n return true\n }\n\n const reserve = (paths, fn) => {\n const dirs = new Set(\n paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b))\n )\n reservations.set(fn, {dirs, paths})\n paths.forEach(path => {\n const q = queues.get(path)\n if (!q)\n queues.set(path, [fn])\n else\n q.push(fn)\n })\n dirs.forEach(dir => {\n const q = queues.get(dir)\n if (!q)\n queues.set(dir, [new Set([fn])])\n else if (q[q.length - 1] instanceof Set)\n q[q.length - 1].add(fn)\n else\n q.push(new Set([fn]))\n })\n\n return run(fn)\n }\n\n return { check, reserve }\n}\n","'use strict'\nconst Header = require('./header.js')\nconst path = require('path')\n\nclass Pax {\n constructor (obj, global) {\n this.atime = obj.atime || null\n this.charset = obj.charset || null\n this.comment = obj.comment || null\n this.ctime = obj.ctime || null\n this.gid = obj.gid || null\n this.gname = obj.gname || null\n this.linkpath = obj.linkpath || null\n this.mtime = obj.mtime || null\n this.path = obj.path || null\n this.size = obj.size || null\n this.uid = obj.uid || null\n this.uname = obj.uname || null\n this.dev = obj.dev || null\n this.ino = obj.ino || null\n this.nlink = obj.nlink || null\n this.global = global || false\n }\n\n encode () {\n const body = this.encodeBody()\n if (body === '')\n return null\n\n const bodyLen = Buffer.byteLength(body)\n // round up to 512 bytes\n // add 512 for header\n const bufLen = 512 * Math.ceil(1 + bodyLen / 512)\n const buf = Buffer.allocUnsafe(bufLen)\n\n // 0-fill the header section, it might not hit every field\n for (let i = 0; i < 512; i++)\n buf[i] = 0\n\n new Header({\n // XXX split the path\n // then the path should be PaxHeader + basename, but less than 99,\n // prepend with the dirname\n path: ('PaxHeader/' + path.basename(this.path)).slice(0, 99),\n mode: this.mode || 0o644,\n uid: this.uid || null,\n gid: this.gid || null,\n size: bodyLen,\n mtime: this.mtime || null,\n type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader',\n linkpath: '',\n uname: this.uname || '',\n gname: this.gname || '',\n devmaj: 0,\n devmin: 0,\n atime: this.atime || null,\n ctime: this.ctime || null,\n }).encode(buf)\n\n buf.write(body, 512, bodyLen, 'utf8')\n\n // null pad after the body\n for (let i = bodyLen + 512; i < buf.length; i++)\n buf[i] = 0\n\n return buf\n }\n\n encodeBody () {\n return (\n this.encodeField('path') +\n this.encodeField('ctime') +\n this.encodeField('atime') +\n this.encodeField('dev') +\n this.encodeField('ino') +\n this.encodeField('nlink') +\n this.encodeField('charset') +\n this.encodeField('comment') +\n this.encodeField('gid') +\n this.encodeField('gname') +\n this.encodeField('linkpath') +\n this.encodeField('mtime') +\n this.encodeField('size') +\n this.encodeField('uid') +\n this.encodeField('uname')\n )\n }\n\n encodeField (field) {\n if (this[field] === null || this[field] === undefined)\n return ''\n const v = this[field] instanceof Date ? this[field].getTime() / 1000\n : this[field]\n const s = ' ' +\n (field === 'dev' || field === 'ino' || field === 'nlink'\n ? 'SCHILY.' : '') +\n field + '=' + v + '\\n'\n const byteLen = Buffer.byteLength(s)\n // the digits includes the length of the digits in ascii base-10\n // so if it's 9 characters, then adding 1 for the 9 makes it 10\n // which makes it 11 chars.\n let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1\n if (byteLen + digits >= Math.pow(10, digits))\n digits += 1\n const len = digits + byteLen\n return len + s\n }\n}\n\nPax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g)\n\nconst merge = (a, b) =>\n b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a\n\nconst parseKV = string =>\n string\n .replace(/\\n$/, '')\n .split('\\n')\n .reduce(parseKVLine, Object.create(null))\n\nconst parseKVLine = (set, line) => {\n const n = parseInt(line, 10)\n\n // XXX Values with \\n in them will fail this.\n // Refactor to not be a naive line-by-line parse.\n if (n !== Buffer.byteLength(line) + 1)\n return set\n\n line = line.substr((n + ' ').length)\n const kv = line.split('=')\n const k = kv.shift().replace(/^SCHILY\\.(dev|ino|nlink)/, '$1')\n if (!k)\n return set\n\n const v = kv.join('=')\n set[k] = /^([A-Z]+\\.)?([mac]|birth|creation)time$/.test(k)\n ? new Date(v * 1000)\n : /^[0-9]+$/.test(v) ? +v\n : v\n return set\n}\n\nmodule.exports = Pax\n","'use strict'\nconst MiniPass = require('minipass')\n\nconst SLURP = Symbol('slurp')\nmodule.exports = class ReadEntry extends MiniPass {\n constructor (header, ex, gex) {\n super()\n // read entries always start life paused. this is to avoid the\n // situation where Minipass's auto-ending empty streams results\n // in an entry ending before we're ready for it.\n this.pause()\n this.extended = ex\n this.globalExtended = gex\n this.header = header\n this.startBlockSize = 512 * Math.ceil(header.size / 512)\n this.blockRemain = this.startBlockSize\n this.remain = header.size\n this.type = header.type\n this.meta = false\n this.ignore = false\n switch (this.type) {\n case 'File':\n case 'OldFile':\n case 'Link':\n case 'SymbolicLink':\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'Directory':\n case 'FIFO':\n case 'ContiguousFile':\n case 'GNUDumpDir':\n break\n\n case 'NextFileHasLongLinkpath':\n case 'NextFileHasLongPath':\n case 'OldGnuLongPath':\n case 'GlobalExtendedHeader':\n case 'ExtendedHeader':\n case 'OldExtendedHeader':\n this.meta = true\n break\n\n // NOTE: gnutar and bsdtar treat unrecognized types as 'File'\n // it may be worth doing the same, but with a warning.\n default:\n this.ignore = true\n }\n\n this.path = header.path\n this.mode = header.mode\n if (this.mode)\n this.mode = this.mode & 0o7777\n this.uid = header.uid\n this.gid = header.gid\n this.uname = header.uname\n this.gname = header.gname\n this.size = header.size\n this.mtime = header.mtime\n this.atime = header.atime\n this.ctime = header.ctime\n this.linkpath = header.linkpath\n this.uname = header.uname\n this.gname = header.gname\n\n if (ex)\n this[SLURP](ex)\n if (gex)\n this[SLURP](gex, true)\n }\n\n write (data) {\n const writeLen = data.length\n if (writeLen > this.blockRemain)\n throw new Error('writing more to entry than is appropriate')\n\n const r = this.remain\n const br = this.blockRemain\n this.remain = Math.max(0, r - writeLen)\n this.blockRemain = Math.max(0, br - writeLen)\n if (this.ignore)\n return true\n\n if (r >= writeLen)\n return super.write(data)\n\n // r < writeLen\n return super.write(data.slice(0, r))\n }\n\n [SLURP] (ex, global) {\n for (const k in ex) {\n // we slurp in everything except for the path attribute in\n // a global extended header, because that's weird.\n if (ex[k] !== null && ex[k] !== undefined &&\n !(global && k === 'path'))\n this[k] = ex[k]\n }\n }\n}\n","'use strict'\n\n// tar -r\nconst hlo = require('./high-level-opt.js')\nconst Pack = require('./pack.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst t = require('./list.js')\nconst path = require('path')\n\n// starting at the head of the file, read a Header\n// If the checksum is invalid, that's our position to start writing\n// If it is, jump forward by the specified size (round up to 512)\n// and try again.\n// Write the new Pack stream starting there.\n\nconst Header = require('./header.js')\n\nmodule.exports = (opt_, files, cb) => {\n const opt = hlo(opt_)\n\n if (!opt.file)\n throw new TypeError('file is required')\n\n if (opt.gzip)\n throw new TypeError('cannot append to compressed archives')\n\n if (!files || !Array.isArray(files) || !files.length)\n throw new TypeError('no files or directories specified')\n\n files = Array.from(files)\n\n return opt.sync ? replaceSync(opt, files)\n : replace(opt, files, cb)\n}\n\nconst replaceSync = (opt, files) => {\n const p = new Pack.Sync(opt)\n\n let threw = true\n let fd\n let position\n\n try {\n try {\n fd = fs.openSync(opt.file, 'r+')\n } catch (er) {\n if (er.code === 'ENOENT')\n fd = fs.openSync(opt.file, 'w+')\n else\n throw er\n }\n\n const st = fs.fstatSync(fd)\n const headBuf = Buffer.alloc(512)\n\n POSITION: for (position = 0; position < st.size; position += 512) {\n for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {\n bytes = fs.readSync(\n fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos\n )\n\n if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b)\n throw new Error('cannot append to compressed archives')\n\n if (!bytes)\n break POSITION\n }\n\n const h = new Header(headBuf)\n if (!h.cksumValid)\n break\n const entryBlockSize = 512 * Math.ceil(h.size / 512)\n if (position + entryBlockSize + 512 > st.size)\n break\n // the 512 for the header we just parsed will be added as well\n // also jump ahead all the blocks for the body\n position += entryBlockSize\n if (opt.mtimeCache)\n opt.mtimeCache.set(h.path, h.mtime)\n }\n threw = false\n\n streamSync(opt, p, position, fd, files)\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n }\n }\n}\n\nconst streamSync = (opt, p, position, fd, files) => {\n const stream = new fsm.WriteStreamSync(opt.file, {\n fd: fd,\n start: position,\n })\n p.pipe(stream)\n addFilesSync(p, files)\n}\n\nconst replace = (opt, files, cb) => {\n files = Array.from(files)\n const p = new Pack(opt)\n\n const getPos = (fd, size, cb_) => {\n const cb = (er, pos) => {\n if (er)\n fs.close(fd, _ => cb_(er))\n else\n cb_(null, pos)\n }\n\n let position = 0\n if (size === 0)\n return cb(null, 0)\n\n let bufPos = 0\n const headBuf = Buffer.alloc(512)\n const onread = (er, bytes) => {\n if (er)\n return cb(er)\n bufPos += bytes\n if (bufPos < 512 && bytes) {\n return fs.read(\n fd, headBuf, bufPos, headBuf.length - bufPos,\n position + bufPos, onread\n )\n }\n\n if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b)\n return cb(new Error('cannot append to compressed archives'))\n\n // truncated header\n if (bufPos < 512)\n return cb(null, position)\n\n const h = new Header(headBuf)\n if (!h.cksumValid)\n return cb(null, position)\n\n const entryBlockSize = 512 * Math.ceil(h.size / 512)\n if (position + entryBlockSize + 512 > size)\n return cb(null, position)\n\n position += entryBlockSize + 512\n if (position >= size)\n return cb(null, position)\n\n if (opt.mtimeCache)\n opt.mtimeCache.set(h.path, h.mtime)\n bufPos = 0\n fs.read(fd, headBuf, 0, 512, position, onread)\n }\n fs.read(fd, headBuf, 0, 512, position, onread)\n }\n\n const promise = new Promise((resolve, reject) => {\n p.on('error', reject)\n let flag = 'r+'\n const onopen = (er, fd) => {\n if (er && er.code === 'ENOENT' && flag === 'r+') {\n flag = 'w+'\n return fs.open(opt.file, flag, onopen)\n }\n\n if (er)\n return reject(er)\n\n fs.fstat(fd, (er, st) => {\n if (er)\n return reject(er)\n getPos(fd, st.size, (er, position) => {\n if (er)\n return reject(er)\n const stream = new fsm.WriteStream(opt.file, {\n fd: fd,\n start: position,\n })\n p.pipe(stream)\n stream.on('error', reject)\n stream.on('close', resolve)\n addFilesAsync(p, files)\n })\n })\n }\n fs.open(opt.file, flag, onopen)\n })\n\n return cb ? promise.then(cb, cb) : promise\n}\n\nconst addFilesSync = (p, files) => {\n files.forEach(file => {\n if (file.charAt(0) === '@') {\n t({\n file: path.resolve(p.cwd, file.substr(1)),\n sync: true,\n noResume: true,\n onentry: entry => p.add(entry),\n })\n } else\n p.add(file)\n })\n p.end()\n}\n\nconst addFilesAsync = (p, files) => {\n while (files.length) {\n const file = files.shift()\n if (file.charAt(0) === '@') {\n return t({\n file: path.resolve(p.cwd, file.substr(1)),\n noResume: true,\n onentry: entry => p.add(entry),\n }).then(_ => addFilesAsync(p, files))\n } else\n p.add(file)\n }\n p.end()\n}\n","'use strict'\n// map types from key to human-friendly name\nexports.name = new Map([\n ['0', 'File'],\n // same as File\n ['', 'OldFile'],\n ['1', 'Link'],\n ['2', 'SymbolicLink'],\n // Devices and FIFOs aren't fully supported\n // they are parsed, but skipped when unpacking\n ['3', 'CharacterDevice'],\n ['4', 'BlockDevice'],\n ['5', 'Directory'],\n ['6', 'FIFO'],\n // same as File\n ['7', 'ContiguousFile'],\n // pax headers\n ['g', 'GlobalExtendedHeader'],\n ['x', 'ExtendedHeader'],\n // vendor-specific stuff\n // skip\n ['A', 'SolarisACL'],\n // like 5, but with data, which should be skipped\n ['D', 'GNUDumpDir'],\n // metadata only, skip\n ['I', 'Inode'],\n // data = link path of next file\n ['K', 'NextFileHasLongLinkpath'],\n // data = path of next file\n ['L', 'NextFileHasLongPath'],\n // skip\n ['M', 'ContinuationFile'],\n // like L\n ['N', 'OldGnuLongPath'],\n // skip\n ['S', 'SparseFile'],\n // skip\n ['V', 'TapeVolumeHeader'],\n // like x\n ['X', 'OldExtendedHeader'],\n])\n\n// map the other direction\nexports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]]))\n","'use strict'\n\n// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet.\n// but the path reservations are required to avoid race conditions where\n// parallelized unpack ops may mess with one another, due to dependencies\n// (like a Link depending on its target) or destructive operations (like\n// clobbering an fs object to create one of a different type.)\n\nconst assert = require('assert')\nconst Parser = require('./parse.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst path = require('path')\nconst mkdir = require('./mkdir.js')\nconst wc = require('./winchars.js')\nconst pathReservations = require('./path-reservations.js')\n\nconst ONENTRY = Symbol('onEntry')\nconst CHECKFS = Symbol('checkFs')\nconst CHECKFS2 = Symbol('checkFs2')\nconst ISREUSABLE = Symbol('isReusable')\nconst MAKEFS = Symbol('makeFs')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst LINK = Symbol('link')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst UNSUPPORTED = Symbol('unsupported')\nconst CHECKPATH = Symbol('checkPath')\nconst MKDIR = Symbol('mkdir')\nconst ONERROR = Symbol('onError')\nconst PENDING = Symbol('pending')\nconst PEND = Symbol('pend')\nconst UNPEND = Symbol('unpend')\nconst ENDED = Symbol('ended')\nconst MAYBECLOSE = Symbol('maybeClose')\nconst SKIP = Symbol('skip')\nconst DOCHOWN = Symbol('doChown')\nconst UID = Symbol('uid')\nconst GID = Symbol('gid')\nconst crypto = require('crypto')\nconst getFlag = require('./get-write-flag.js')\n\n/* istanbul ignore next */\nconst neverCalled = () => {\n throw new Error('sync function called cb somehow?!?')\n}\n\n// Unlinks on Windows are not atomic.\n//\n// This means that if you have a file entry, followed by another\n// file entry with an identical name, and you cannot re-use the file\n// (because it's a hardlink, or because unlink:true is set, or it's\n// Windows, which does not have useful nlink values), then the unlink\n// will be committed to the disk AFTER the new file has been written\n// over the old one, deleting the new file.\n//\n// To work around this, on Windows systems, we rename the file and then\n// delete the renamed file. It's a sloppy kludge, but frankly, I do not\n// know of a better way to do this, given windows' non-atomic unlink\n// semantics.\n//\n// See: https://github.com/npm/node-tar/issues/183\n/* istanbul ignore next */\nconst unlinkFile = (path, cb) => {\n if (process.platform !== 'win32')\n return fs.unlink(path, cb)\n\n const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')\n fs.rename(path, name, er => {\n if (er)\n return cb(er)\n fs.unlink(name, cb)\n })\n}\n\n/* istanbul ignore next */\nconst unlinkFileSync = path => {\n if (process.platform !== 'win32')\n return fs.unlinkSync(path)\n\n const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')\n fs.renameSync(path, name)\n fs.unlinkSync(name)\n}\n\n// this.gid, entry.gid, this.processUid\nconst uint32 = (a, b, c) =>\n a === a >>> 0 ? a\n : b === b >>> 0 ? b\n : c\n\nclass Unpack extends Parser {\n constructor (opt) {\n if (!opt)\n opt = {}\n\n opt.ondone = _ => {\n this[ENDED] = true\n this[MAYBECLOSE]()\n }\n\n super(opt)\n\n this.reservations = pathReservations()\n\n this.transform = typeof opt.transform === 'function' ? opt.transform : null\n\n this.writable = true\n this.readable = false\n\n this[PENDING] = 0\n this[ENDED] = false\n\n this.dirCache = opt.dirCache || new Map()\n\n if (typeof opt.uid === 'number' || typeof opt.gid === 'number') {\n // need both or neither\n if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number')\n throw new TypeError('cannot set owner without number uid and gid')\n if (opt.preserveOwner) {\n throw new TypeError(\n 'cannot preserve owner in archive and also set owner explicitly')\n }\n this.uid = opt.uid\n this.gid = opt.gid\n this.setOwner = true\n } else {\n this.uid = null\n this.gid = null\n this.setOwner = false\n }\n\n // default true for root\n if (opt.preserveOwner === undefined && typeof opt.uid !== 'number')\n this.preserveOwner = process.getuid && process.getuid() === 0\n else\n this.preserveOwner = !!opt.preserveOwner\n\n this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ?\n process.getuid() : null\n this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ?\n process.getgid() : null\n\n // mostly just for testing, but useful in some cases.\n // Forcibly trigger a chown on every entry, no matter what\n this.forceChown = opt.forceChown === true\n\n // turn > this[ONENTRY](entry))\n }\n\n // a bad or damaged archive is a warning for Parser, but an error\n // when extracting. Mark those errors as unrecoverable, because\n // the Unpack contract cannot be met.\n warn (code, msg, data = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT')\n data.recoverable = false\n return super.warn(code, msg, data)\n }\n\n [MAYBECLOSE] () {\n if (this[ENDED] && this[PENDING] === 0) {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n this.emit('close')\n }\n }\n\n [CHECKPATH] (entry) {\n if (this.strip) {\n const parts = entry.path.split(/\\/|\\\\/)\n if (parts.length < this.strip)\n return false\n entry.path = parts.slice(this.strip).join('/')\n\n if (entry.type === 'Link') {\n const linkparts = entry.linkpath.split(/\\/|\\\\/)\n if (linkparts.length >= this.strip)\n entry.linkpath = linkparts.slice(this.strip).join('/')\n }\n }\n\n if (!this.preservePaths) {\n const p = entry.path\n if (p.match(/(^|\\/|\\\\)\\.\\.(\\\\|\\/|$)/)) {\n this.warn('TAR_ENTRY_ERROR', `path contains '..'`, {\n entry,\n path: p,\n })\n return false\n }\n\n // absolutes on posix are also absolutes on win32\n // so we only need to test this one to get both\n if (path.win32.isAbsolute(p)) {\n const parsed = path.win32.parse(p)\n entry.path = p.substr(parsed.root.length)\n const r = parsed.root\n this.warn('TAR_ENTRY_INFO', `stripping ${r} from absolute path`, {\n entry,\n path: p,\n })\n }\n }\n\n // only encode : chars that aren't drive letter indicators\n if (this.win32) {\n const parsed = path.win32.parse(entry.path)\n entry.path = parsed.root === '' ? wc.encode(entry.path)\n : parsed.root + wc.encode(entry.path.substr(parsed.root.length))\n }\n\n if (path.isAbsolute(entry.path))\n entry.absolute = entry.path\n else\n entry.absolute = path.resolve(this.cwd, entry.path)\n\n return true\n }\n\n [ONENTRY] (entry) {\n if (!this[CHECKPATH](entry))\n return entry.resume()\n\n assert.equal(typeof entry.absolute, 'string')\n\n switch (entry.type) {\n case 'Directory':\n case 'GNUDumpDir':\n if (entry.mode)\n entry.mode = entry.mode | 0o700\n\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n case 'Link':\n case 'SymbolicLink':\n return this[CHECKFS](entry)\n\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'FIFO':\n default:\n return this[UNSUPPORTED](entry)\n }\n }\n\n [ONERROR] (er, entry) {\n // Cwd has to exist, or else nothing works. That's serious.\n // Other errors are warnings, which raise the error in strict\n // mode, but otherwise continue on.\n if (er.name === 'CwdError')\n this.emit('error', er)\n else {\n this.warn('TAR_ENTRY_ERROR', er, {entry})\n this[UNPEND]()\n entry.resume()\n }\n }\n\n [MKDIR] (dir, mode, cb) {\n mkdir(dir, {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cache: this.dirCache,\n cwd: this.cwd,\n mode: mode,\n noChmod: this.noChmod,\n }, cb)\n }\n\n [DOCHOWN] (entry) {\n // in preserve owner mode, chown if the entry doesn't match process\n // in set owner mode, chown if setting doesn't match process\n return this.forceChown ||\n this.preserveOwner &&\n (typeof entry.uid === 'number' && entry.uid !== this.processUid ||\n typeof entry.gid === 'number' && entry.gid !== this.processGid)\n ||\n (typeof this.uid === 'number' && this.uid !== this.processUid ||\n typeof this.gid === 'number' && this.gid !== this.processGid)\n }\n\n [UID] (entry) {\n return uint32(this.uid, entry.uid, this.processUid)\n }\n\n [GID] (entry) {\n return uint32(this.gid, entry.gid, this.processGid)\n }\n\n [FILE] (entry, fullyDone) {\n const mode = entry.mode & 0o7777 || this.fmode\n const stream = new fsm.WriteStream(entry.absolute, {\n flags: getFlag(entry.size),\n mode: mode,\n autoClose: false,\n })\n stream.on('error', er => this[ONERROR](er, entry))\n\n let actions = 1\n const done = er => {\n if (er)\n return this[ONERROR](er, entry)\n\n if (--actions === 0) {\n fs.close(stream.fd, er => {\n fullyDone()\n er ? this[ONERROR](er, entry) : this[UNPEND]()\n })\n }\n }\n\n stream.on('finish', _ => {\n // if futimes fails, try utimes\n // if utimes fails, fail with the original error\n // same for fchown/chown\n const abs = entry.absolute\n const fd = stream.fd\n\n if (entry.mtime && !this.noMtime) {\n actions++\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n fs.futimes(fd, atime, mtime, er =>\n er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er))\n : done())\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n fs.fchown(fd, uid, gid, er =>\n er ? fs.chown(abs, uid, gid, er2 => done(er2 && er))\n : done())\n }\n\n done()\n })\n\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', er => this[ONERROR](er, entry))\n entry.pipe(tx)\n }\n tx.pipe(stream)\n }\n\n [DIRECTORY] (entry, fullyDone) {\n const mode = entry.mode & 0o7777 || this.dmode\n this[MKDIR](entry.absolute, mode, er => {\n if (er) {\n fullyDone()\n return this[ONERROR](er, entry)\n }\n\n let actions = 1\n const done = _ => {\n if (--actions === 0) {\n fullyDone()\n this[UNPEND]()\n entry.resume()\n }\n }\n\n if (entry.mtime && !this.noMtime) {\n actions++\n fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, done)\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n fs.chown(entry.absolute, this[UID](entry), this[GID](entry), done)\n }\n\n done()\n })\n }\n\n [UNSUPPORTED] (entry) {\n entry.unsupported = true\n this.warn('TAR_ENTRY_UNSUPPORTED',\n `unsupported entry type: ${entry.type}`, {entry})\n entry.resume()\n }\n\n [SYMLINK] (entry, done) {\n this[LINK](entry, entry.linkpath, 'symlink', done)\n }\n\n [HARDLINK] (entry, done) {\n this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link', done)\n }\n\n [PEND] () {\n this[PENDING]++\n }\n\n [UNPEND] () {\n this[PENDING]--\n this[MAYBECLOSE]()\n }\n\n [SKIP] (entry) {\n this[UNPEND]()\n entry.resume()\n }\n\n // Check if we can reuse an existing filesystem entry safely and\n // overwrite it, rather than unlinking and recreating\n // Windows doesn't report a useful nlink, so we just never reuse entries\n [ISREUSABLE] (entry, st) {\n return entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n process.platform !== 'win32'\n }\n\n // check if a thing is there, and if so, try to clobber it\n [CHECKFS] (entry) {\n this[PEND]()\n const paths = [entry.path]\n if (entry.linkpath)\n paths.push(entry.linkpath)\n this.reservations.reserve(paths, done => this[CHECKFS2](entry, done))\n }\n\n [CHECKFS2] (entry, done) {\n this[MKDIR](path.dirname(entry.absolute), this.dmode, er => {\n if (er) {\n done()\n return this[ONERROR](er, entry)\n }\n fs.lstat(entry.absolute, (er, st) => {\n if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {\n this[SKIP](entry)\n done()\n } else if (er || this[ISREUSABLE](entry, st))\n this[MAKEFS](null, entry, done)\n\n else if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n if (!this.noChmod && (!entry.mode || (st.mode & 0o7777) === entry.mode))\n this[MAKEFS](null, entry, done)\n else {\n fs.chmod(entry.absolute, entry.mode,\n er => this[MAKEFS](er, entry, done))\n }\n } else\n fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry, done))\n } else\n unlinkFile(entry.absolute, er => this[MAKEFS](er, entry, done))\n })\n })\n }\n\n [MAKEFS] (er, entry, done) {\n if (er)\n return this[ONERROR](er, entry)\n\n switch (entry.type) {\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n return this[FILE](entry, done)\n\n case 'Link':\n return this[HARDLINK](entry, done)\n\n case 'SymbolicLink':\n return this[SYMLINK](entry, done)\n\n case 'Directory':\n case 'GNUDumpDir':\n return this[DIRECTORY](entry, done)\n }\n }\n\n [LINK] (entry, linkpath, link, done) {\n // XXX: get the type ('file' or 'dir') for windows\n fs[link](linkpath, entry.absolute, er => {\n if (er)\n return this[ONERROR](er, entry)\n done()\n this[UNPEND]()\n entry.resume()\n })\n }\n}\n\nclass UnpackSync extends Unpack {\n [CHECKFS] (entry) {\n const er = this[MKDIR](path.dirname(entry.absolute), this.dmode, neverCalled)\n if (er)\n return this[ONERROR](er, entry)\n try {\n const st = fs.lstatSync(entry.absolute)\n if (this.keep || this.newer && st.mtime > entry.mtime)\n return this[SKIP](entry)\n else if (this[ISREUSABLE](entry, st))\n return this[MAKEFS](null, entry, neverCalled)\n else {\n try {\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n if (!this.noChmod && entry.mode && (st.mode & 0o7777) !== entry.mode)\n fs.chmodSync(entry.absolute, entry.mode)\n } else\n fs.rmdirSync(entry.absolute)\n } else\n unlinkFileSync(entry.absolute)\n return this[MAKEFS](null, entry, neverCalled)\n } catch (er) {\n return this[ONERROR](er, entry)\n }\n }\n } catch (er) {\n return this[MAKEFS](null, entry, neverCalled)\n }\n }\n\n [FILE] (entry, _) {\n const mode = entry.mode & 0o7777 || this.fmode\n\n const oner = er => {\n let closeError\n try {\n fs.closeSync(fd)\n } catch (e) {\n closeError = e\n }\n if (er || closeError)\n this[ONERROR](er || closeError, entry)\n }\n\n let fd\n try {\n fd = fs.openSync(entry.absolute, getFlag(entry.size), mode)\n } catch (er) {\n return oner(er)\n }\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', er => this[ONERROR](er, entry))\n entry.pipe(tx)\n }\n\n tx.on('data', chunk => {\n try {\n fs.writeSync(fd, chunk, 0, chunk.length)\n } catch (er) {\n oner(er)\n }\n })\n\n tx.on('end', _ => {\n let er = null\n // try both, falling futimes back to utimes\n // if either fails, handle the first error\n if (entry.mtime && !this.noMtime) {\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n try {\n fs.futimesSync(fd, atime, mtime)\n } catch (futimeser) {\n try {\n fs.utimesSync(entry.absolute, atime, mtime)\n } catch (utimeser) {\n er = futimeser\n }\n }\n }\n\n if (this[DOCHOWN](entry)) {\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n\n try {\n fs.fchownSync(fd, uid, gid)\n } catch (fchowner) {\n try {\n fs.chownSync(entry.absolute, uid, gid)\n } catch (chowner) {\n er = er || fchowner\n }\n }\n }\n\n oner(er)\n })\n }\n\n [DIRECTORY] (entry, _) {\n const mode = entry.mode & 0o7777 || this.dmode\n const er = this[MKDIR](entry.absolute, mode)\n if (er)\n return this[ONERROR](er, entry)\n if (entry.mtime && !this.noMtime) {\n try {\n fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime)\n } catch (er) {}\n }\n if (this[DOCHOWN](entry)) {\n try {\n fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry))\n } catch (er) {}\n }\n entry.resume()\n }\n\n [MKDIR] (dir, mode) {\n try {\n return mkdir.sync(dir, {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cache: this.dirCache,\n cwd: this.cwd,\n mode: mode,\n })\n } catch (er) {\n return er\n }\n }\n\n [LINK] (entry, linkpath, link, _) {\n try {\n fs[link + 'Sync'](linkpath, entry.absolute)\n entry.resume()\n } catch (er) {\n return this[ONERROR](er, entry)\n }\n }\n}\n\nUnpack.Sync = UnpackSync\nmodule.exports = Unpack\n","'use strict'\n\n// tar -u\n\nconst hlo = require('./high-level-opt.js')\nconst r = require('./replace.js')\n// just call tar.r with the filter and mtimeCache\n\nmodule.exports = (opt_, files, cb) => {\n const opt = hlo(opt_)\n\n if (!opt.file)\n throw new TypeError('file is required')\n\n if (opt.gzip)\n throw new TypeError('cannot append to compressed archives')\n\n if (!files || !Array.isArray(files) || !files.length)\n throw new TypeError('no files or directories specified')\n\n files = Array.from(files)\n\n mtimeFilter(opt)\n return r(opt, files, cb)\n}\n\nconst mtimeFilter = opt => {\n const filter = opt.filter\n\n if (!opt.mtimeCache)\n opt.mtimeCache = new Map()\n\n opt.filter = filter ? (path, stat) =>\n filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime)\n : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime)\n}\n","'use strict'\nmodule.exports = Base => class extends Base {\n warn (code, message, data = {}) {\n if (this.file)\n data.file = this.file\n if (this.cwd)\n data.cwd = this.cwd\n data.code = message instanceof Error && message.code || code\n data.tarCode = code\n if (!this.strict && data.recoverable !== false) {\n if (message instanceof Error) {\n data = Object.assign(message, data)\n message = message.message\n }\n this.emit('warn', data.tarCode, message, data)\n } else if (message instanceof Error)\n this.emit('error', Object.assign(message, data))\n else\n this.emit('error', Object.assign(new Error(`${code}: ${message}`), data))\n }\n}\n","'use strict'\n\n// When writing files on Windows, translate the characters to their\n// 0xf000 higher-encoded versions.\n\nconst raw = [\n '|',\n '<',\n '>',\n '?',\n ':',\n]\n\nconst win = raw.map(char =>\n String.fromCharCode(0xf000 + char.charCodeAt(0)))\n\nconst toWin = new Map(raw.map((char, i) => [char, win[i]]))\nconst toRaw = new Map(win.map((char, i) => [char, raw[i]]))\n\nmodule.exports = {\n encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s),\n decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s),\n}\n","'use strict'\nconst MiniPass = require('minipass')\nconst Pax = require('./pax.js')\nconst Header = require('./header.js')\nconst fs = require('fs')\nconst path = require('path')\n\nconst maxReadSize = 16 * 1024 * 1024\nconst PROCESS = Symbol('process')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst HEADER = Symbol('header')\nconst READ = Symbol('read')\nconst LSTAT = Symbol('lstat')\nconst ONLSTAT = Symbol('onlstat')\nconst ONREAD = Symbol('onread')\nconst ONREADLINK = Symbol('onreadlink')\nconst OPENFILE = Symbol('openfile')\nconst ONOPENFILE = Symbol('onopenfile')\nconst CLOSE = Symbol('close')\nconst MODE = Symbol('mode')\nconst warner = require('./warn-mixin.js')\nconst winchars = require('./winchars.js')\n\nconst modeFix = require('./mode-fix.js')\n\nconst WriteEntry = warner(class WriteEntry extends MiniPass {\n constructor (p, opt) {\n opt = opt || {}\n super(opt)\n if (typeof p !== 'string')\n throw new TypeError('path is required')\n this.path = p\n // suppress atime, ctime, uid, gid, uname, gname\n this.portable = !!opt.portable\n // until node has builtin pwnam functions, this'll have to do\n this.myuid = process.getuid && process.getuid()\n this.myuser = process.env.USER || ''\n this.maxReadSize = opt.maxReadSize || maxReadSize\n this.linkCache = opt.linkCache || new Map()\n this.statCache = opt.statCache || new Map()\n this.preservePaths = !!opt.preservePaths\n this.cwd = opt.cwd || process.cwd()\n this.strict = !!opt.strict\n this.noPax = !!opt.noPax\n this.noMtime = !!opt.noMtime\n this.mtime = opt.mtime || null\n\n if (typeof opt.onwarn === 'function')\n this.on('warn', opt.onwarn)\n\n let pathWarn = false\n if (!this.preservePaths && path.win32.isAbsolute(p)) {\n // absolutes on posix are also absolutes on win32\n // so we only need to test this one to get both\n const parsed = path.win32.parse(p)\n this.path = p.substr(parsed.root.length)\n pathWarn = parsed.root\n }\n\n this.win32 = !!opt.win32 || process.platform === 'win32'\n if (this.win32) {\n this.path = winchars.decode(this.path.replace(/\\\\/g, '/'))\n p = p.replace(/\\\\/g, '/')\n }\n\n this.absolute = opt.absolute || path.resolve(this.cwd, p)\n\n if (this.path === '')\n this.path = './'\n\n if (pathWarn) {\n this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, {\n entry: this,\n path: pathWarn + this.path,\n })\n }\n\n if (this.statCache.has(this.absolute))\n this[ONLSTAT](this.statCache.get(this.absolute))\n else\n this[LSTAT]()\n }\n\n [LSTAT] () {\n fs.lstat(this.absolute, (er, stat) => {\n if (er)\n return this.emit('error', er)\n this[ONLSTAT](stat)\n })\n }\n\n [ONLSTAT] (stat) {\n this.statCache.set(this.absolute, stat)\n this.stat = stat\n if (!stat.isFile())\n stat.size = 0\n this.type = getType(stat)\n this.emit('stat', stat)\n this[PROCESS]()\n }\n\n [PROCESS] () {\n switch (this.type) {\n case 'File': return this[FILE]()\n case 'Directory': return this[DIRECTORY]()\n case 'SymbolicLink': return this[SYMLINK]()\n // unsupported types are ignored.\n default: return this.end()\n }\n }\n\n [MODE] (mode) {\n return modeFix(mode, this.type === 'Directory', this.portable)\n }\n\n [HEADER] () {\n if (this.type === 'Directory' && this.portable)\n this.noMtime = true\n\n this.header = new Header({\n path: this.path,\n linkpath: this.linkpath,\n // only the permissions and setuid/setgid/sticky bitflags\n // not the higher-order bits that specify file type\n mode: this[MODE](this.stat.mode),\n uid: this.portable ? null : this.stat.uid,\n gid: this.portable ? null : this.stat.gid,\n size: this.stat.size,\n mtime: this.noMtime ? null : this.mtime || this.stat.mtime,\n type: this.type,\n uname: this.portable ? null :\n this.stat.uid === this.myuid ? this.myuser : '',\n atime: this.portable ? null : this.stat.atime,\n ctime: this.portable ? null : this.stat.ctime,\n })\n\n if (this.header.encode() && !this.noPax) {\n this.write(new Pax({\n atime: this.portable ? null : this.header.atime,\n ctime: this.portable ? null : this.header.ctime,\n gid: this.portable ? null : this.header.gid,\n mtime: this.noMtime ? null : this.mtime || this.header.mtime,\n path: this.path,\n linkpath: this.linkpath,\n size: this.header.size,\n uid: this.portable ? null : this.header.uid,\n uname: this.portable ? null : this.header.uname,\n dev: this.portable ? null : this.stat.dev,\n ino: this.portable ? null : this.stat.ino,\n nlink: this.portable ? null : this.stat.nlink,\n }).encode())\n }\n this.write(this.header.block)\n }\n\n [DIRECTORY] () {\n if (this.path.substr(-1) !== '/')\n this.path += '/'\n this.stat.size = 0\n this[HEADER]()\n this.end()\n }\n\n [SYMLINK] () {\n fs.readlink(this.absolute, (er, linkpath) => {\n if (er)\n return this.emit('error', er)\n this[ONREADLINK](linkpath)\n })\n }\n\n [ONREADLINK] (linkpath) {\n this.linkpath = linkpath.replace(/\\\\/g, '/')\n this[HEADER]()\n this.end()\n }\n\n [HARDLINK] (linkpath) {\n this.type = 'Link'\n this.linkpath = path.relative(this.cwd, linkpath).replace(/\\\\/g, '/')\n this.stat.size = 0\n this[HEADER]()\n this.end()\n }\n\n [FILE] () {\n if (this.stat.nlink > 1) {\n const linkKey = this.stat.dev + ':' + this.stat.ino\n if (this.linkCache.has(linkKey)) {\n const linkpath = this.linkCache.get(linkKey)\n if (linkpath.indexOf(this.cwd) === 0)\n return this[HARDLINK](linkpath)\n }\n this.linkCache.set(linkKey, this.absolute)\n }\n\n this[HEADER]()\n if (this.stat.size === 0)\n return this.end()\n\n this[OPENFILE]()\n }\n\n [OPENFILE] () {\n fs.open(this.absolute, 'r', (er, fd) => {\n if (er)\n return this.emit('error', er)\n this[ONOPENFILE](fd)\n })\n }\n\n [ONOPENFILE] (fd) {\n const blockLen = 512 * Math.ceil(this.stat.size / 512)\n const bufLen = Math.min(blockLen, this.maxReadSize)\n const buf = Buffer.allocUnsafe(bufLen)\n this[READ](fd, buf, 0, buf.length, 0, this.stat.size, blockLen)\n }\n\n [READ] (fd, buf, offset, length, pos, remain, blockRemain) {\n fs.read(fd, buf, offset, length, pos, (er, bytesRead) => {\n if (er) {\n // ignoring the error from close(2) is a bad practice, but at\n // this point we already have an error, don't need another one\n return this[CLOSE](fd, () => this.emit('error', er))\n }\n this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead)\n })\n }\n\n [CLOSE] (fd, cb) {\n fs.close(fd, cb)\n }\n\n [ONREAD] (fd, buf, offset, length, pos, remain, blockRemain, bytesRead) {\n if (bytesRead <= 0 && remain > 0) {\n const er = new Error('encountered unexpected EOF')\n er.path = this.absolute\n er.syscall = 'read'\n er.code = 'EOF'\n return this[CLOSE](fd, () => this.emit('error', er))\n }\n\n if (bytesRead > remain) {\n const er = new Error('did not encounter expected EOF')\n er.path = this.absolute\n er.syscall = 'read'\n er.code = 'EOF'\n return this[CLOSE](fd, () => this.emit('error', er))\n }\n\n // null out the rest of the buffer, if we could fit the block padding\n if (bytesRead === remain) {\n for (let i = bytesRead; i < length && bytesRead < blockRemain; i++) {\n buf[i + offset] = 0\n bytesRead++\n remain++\n }\n }\n\n const writeBuf = offset === 0 && bytesRead === buf.length ?\n buf : buf.slice(offset, offset + bytesRead)\n remain -= bytesRead\n blockRemain -= bytesRead\n pos += bytesRead\n offset += bytesRead\n\n this.write(writeBuf)\n\n if (!remain) {\n if (blockRemain)\n this.write(Buffer.alloc(blockRemain))\n return this[CLOSE](fd, er => er ? this.emit('error', er) : this.end())\n }\n\n if (offset >= length) {\n buf = Buffer.allocUnsafe(length)\n offset = 0\n }\n length = buf.length - offset\n this[READ](fd, buf, offset, length, pos, remain, blockRemain)\n }\n})\n\nclass WriteEntrySync extends WriteEntry {\n [LSTAT] () {\n this[ONLSTAT](fs.lstatSync(this.absolute))\n }\n\n [SYMLINK] () {\n this[ONREADLINK](fs.readlinkSync(this.absolute))\n }\n\n [OPENFILE] () {\n this[ONOPENFILE](fs.openSync(this.absolute, 'r'))\n }\n\n [READ] (fd, buf, offset, length, pos, remain, blockRemain) {\n let threw = true\n try {\n const bytesRead = fs.readSync(fd, buf, offset, length, pos)\n this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead)\n threw = false\n } finally {\n // ignoring the error from close(2) is a bad practice, but at\n // this point we already have an error, don't need another one\n if (threw) {\n try {\n this[CLOSE](fd, () => {})\n } catch (er) {}\n }\n }\n }\n\n [CLOSE] (fd, cb) {\n fs.closeSync(fd)\n cb()\n }\n}\n\nconst WriteEntryTar = warner(class WriteEntryTar extends MiniPass {\n constructor (readEntry, opt) {\n opt = opt || {}\n super(opt)\n this.preservePaths = !!opt.preservePaths\n this.portable = !!opt.portable\n this.strict = !!opt.strict\n this.noPax = !!opt.noPax\n this.noMtime = !!opt.noMtime\n\n this.readEntry = readEntry\n this.type = readEntry.type\n if (this.type === 'Directory' && this.portable)\n this.noMtime = true\n\n this.path = readEntry.path\n this.mode = this[MODE](readEntry.mode)\n this.uid = this.portable ? null : readEntry.uid\n this.gid = this.portable ? null : readEntry.gid\n this.uname = this.portable ? null : readEntry.uname\n this.gname = this.portable ? null : readEntry.gname\n this.size = readEntry.size\n this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime\n this.atime = this.portable ? null : readEntry.atime\n this.ctime = this.portable ? null : readEntry.ctime\n this.linkpath = readEntry.linkpath\n\n if (typeof opt.onwarn === 'function')\n this.on('warn', opt.onwarn)\n\n let pathWarn = false\n if (path.isAbsolute(this.path) && !this.preservePaths) {\n const parsed = path.parse(this.path)\n pathWarn = parsed.root\n this.path = this.path.substr(parsed.root.length)\n }\n\n this.remain = readEntry.size\n this.blockRemain = readEntry.startBlockSize\n\n this.header = new Header({\n path: this.path,\n linkpath: this.linkpath,\n // only the permissions and setuid/setgid/sticky bitflags\n // not the higher-order bits that specify file type\n mode: this.mode,\n uid: this.portable ? null : this.uid,\n gid: this.portable ? null : this.gid,\n size: this.size,\n mtime: this.noMtime ? null : this.mtime,\n type: this.type,\n uname: this.portable ? null : this.uname,\n atime: this.portable ? null : this.atime,\n ctime: this.portable ? null : this.ctime,\n })\n\n if (pathWarn) {\n this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, {\n entry: this,\n path: pathWarn + this.path,\n })\n }\n\n if (this.header.encode() && !this.noPax) {\n super.write(new Pax({\n atime: this.portable ? null : this.atime,\n ctime: this.portable ? null : this.ctime,\n gid: this.portable ? null : this.gid,\n mtime: this.noMtime ? null : this.mtime,\n path: this.path,\n linkpath: this.linkpath,\n size: this.size,\n uid: this.portable ? null : this.uid,\n uname: this.portable ? null : this.uname,\n dev: this.portable ? null : this.readEntry.dev,\n ino: this.portable ? null : this.readEntry.ino,\n nlink: this.portable ? null : this.readEntry.nlink,\n }).encode())\n }\n\n super.write(this.header.block)\n readEntry.pipe(this)\n }\n\n [MODE] (mode) {\n return modeFix(mode, this.type === 'Directory', this.portable)\n }\n\n write (data) {\n const writeLen = data.length\n if (writeLen > this.blockRemain)\n throw new Error('writing more to entry than is appropriate')\n this.blockRemain -= writeLen\n return super.write(data)\n }\n\n end () {\n if (this.blockRemain)\n this.write(Buffer.alloc(this.blockRemain))\n return super.end()\n }\n})\n\nWriteEntry.Sync = WriteEntrySync\nWriteEntry.Tar = WriteEntryTar\n\nconst getType = stat =>\n stat.isFile() ? 'File'\n : stat.isDirectory() ? 'Directory'\n : stat.isSymbolicLink() ? 'SymbolicLink'\n : 'Unsupported'\n\nmodule.exports = WriteEntry\n","'use strict'\nmodule.exports = function (Yallist) {\n Yallist.prototype[Symbol.iterator] = function* () {\n for (let walker = this.head; walker; walker = walker.next) {\n yield walker.value\n }\n }\n}\n","'use strict'\nmodule.exports = Yallist\n\nYallist.Node = Node\nYallist.create = Yallist\n\nfunction Yallist (list) {\n var self = this\n if (!(self instanceof Yallist)) {\n self = new Yallist()\n }\n\n self.tail = null\n self.head = null\n self.length = 0\n\n if (list && typeof list.forEach === 'function') {\n list.forEach(function (item) {\n self.push(item)\n })\n } else if (arguments.length > 0) {\n for (var i = 0, l = arguments.length; i < l; i++) {\n self.push(arguments[i])\n }\n }\n\n return self\n}\n\nYallist.prototype.removeNode = function (node) {\n if (node.list !== this) {\n throw new Error('removing node which does not belong to this list')\n }\n\n var next = node.next\n var prev = node.prev\n\n if (next) {\n next.prev = prev\n }\n\n if (prev) {\n prev.next = next\n }\n\n if (node === this.head) {\n this.head = next\n }\n if (node === this.tail) {\n this.tail = prev\n }\n\n node.list.length--\n node.next = null\n node.prev = null\n node.list = null\n\n return next\n}\n\nYallist.prototype.unshiftNode = function (node) {\n if (node === this.head) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var head = this.head\n node.list = this\n node.next = head\n if (head) {\n head.prev = node\n }\n\n this.head = node\n if (!this.tail) {\n this.tail = node\n }\n this.length++\n}\n\nYallist.prototype.pushNode = function (node) {\n if (node === this.tail) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var tail = this.tail\n node.list = this\n node.prev = tail\n if (tail) {\n tail.next = node\n }\n\n this.tail = node\n if (!this.head) {\n this.head = node\n }\n this.length++\n}\n\nYallist.prototype.push = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n push(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.unshift = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n unshift(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.pop = function () {\n if (!this.tail) {\n return undefined\n }\n\n var res = this.tail.value\n this.tail = this.tail.prev\n if (this.tail) {\n this.tail.next = null\n } else {\n this.head = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.shift = function () {\n if (!this.head) {\n return undefined\n }\n\n var res = this.head.value\n this.head = this.head.next\n if (this.head) {\n this.head.prev = null\n } else {\n this.tail = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.head, i = 0; walker !== null; i++) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.next\n }\n}\n\nYallist.prototype.forEachReverse = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.prev\n }\n}\n\nYallist.prototype.get = function (n) {\n for (var i = 0, walker = this.head; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.next\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.getReverse = function (n) {\n for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.prev\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.map = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.head; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.next\n }\n return res\n}\n\nYallist.prototype.mapReverse = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.tail; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.prev\n }\n return res\n}\n\nYallist.prototype.reduce = function (fn, initial) {\n var acc\n var walker = this.head\n if (arguments.length > 1) {\n acc = initial\n } else if (this.head) {\n walker = this.head.next\n acc = this.head.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = 0; walker !== null; i++) {\n acc = fn(acc, walker.value, i)\n walker = walker.next\n }\n\n return acc\n}\n\nYallist.prototype.reduceReverse = function (fn, initial) {\n var acc\n var walker = this.tail\n if (arguments.length > 1) {\n acc = initial\n } else if (this.tail) {\n walker = this.tail.prev\n acc = this.tail.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = this.length - 1; walker !== null; i--) {\n acc = fn(acc, walker.value, i)\n walker = walker.prev\n }\n\n return acc\n}\n\nYallist.prototype.toArray = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.head; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.next\n }\n return arr\n}\n\nYallist.prototype.toArrayReverse = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.tail; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.prev\n }\n return arr\n}\n\nYallist.prototype.slice = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = 0, walker = this.head; walker !== null && i < from; i++) {\n walker = walker.next\n }\n for (; walker !== null && i < to; i++, walker = walker.next) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.sliceReverse = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {\n walker = walker.prev\n }\n for (; walker !== null && i > from; i--, walker = walker.prev) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.splice = function (start, deleteCount, ...nodes) {\n if (start > this.length) {\n start = this.length - 1\n }\n if (start < 0) {\n start = this.length + start;\n }\n\n for (var i = 0, walker = this.head; walker !== null && i < start; i++) {\n walker = walker.next\n }\n\n var ret = []\n for (var i = 0; walker && i < deleteCount; i++) {\n ret.push(walker.value)\n walker = this.removeNode(walker)\n }\n if (walker === null) {\n walker = this.tail\n }\n\n if (walker !== this.head && walker !== this.tail) {\n walker = walker.prev\n }\n\n for (var i = 0; i < nodes.length; i++) {\n walker = insert(this, walker, nodes[i])\n }\n return ret;\n}\n\nYallist.prototype.reverse = function () {\n var head = this.head\n var tail = this.tail\n for (var walker = head; walker !== null; walker = walker.prev) {\n var p = walker.prev\n walker.prev = walker.next\n walker.next = p\n }\n this.head = tail\n this.tail = head\n return this\n}\n\nfunction insert (self, node, value) {\n var inserted = node === self.head ?\n new Node(value, null, node, self) :\n new Node(value, node, node.next, self)\n\n if (inserted.next === null) {\n self.tail = inserted\n }\n if (inserted.prev === null) {\n self.head = inserted\n }\n\n self.length++\n\n return inserted\n}\n\nfunction push (self, item) {\n self.tail = new Node(item, self.tail, null, self)\n if (!self.head) {\n self.head = self.tail\n }\n self.length++\n}\n\nfunction unshift (self, item) {\n self.head = new Node(item, null, self.head, self)\n if (!self.tail) {\n self.tail = self.head\n }\n self.length++\n}\n\nfunction Node (value, prev, next, list) {\n if (!(this instanceof Node)) {\n return new Node(value, prev, next, list)\n }\n\n this.list = list\n this.value = value\n\n if (prev) {\n prev.next = this\n this.prev = prev\n } else {\n this.prev = null\n }\n\n if (next) {\n next.prev = this\n this.next = next\n } else {\n this.next = null\n }\n}\n\ntry {\n // add if support for Symbol.iterator is present\n require('./iterator.js')(Yallist)\n} catch (er) {}\n","export const TOKEN_REF = '$jsii.byref';\nexport const TOKEN_INTERFACES = '$jsii.interfaces';\nexport const TOKEN_DATE = '$jsii.date';\nexport const TOKEN_ENUM = '$jsii.enum';\nexport const TOKEN_MAP = '$jsii.map';\nexport const TOKEN_STRUCT = '$jsii.struct';\n\nexport interface ObjRef {\n readonly [TOKEN_REF]: string;\n}\n\nexport interface AnnotatedObjRef extends ObjRef {\n [TOKEN_INTERFACES]?: readonly string[];\n}\n\nexport function isObjRef(value: any): value is ObjRef {\n return typeof value === 'object' && value !== null && TOKEN_REF in value;\n}\n\nexport interface WireDate {\n readonly [TOKEN_DATE]: string;\n}\n\nexport function isWireDate(value: any): value is WireDate {\n return typeof value === 'object' && value !== null && TOKEN_DATE in value;\n}\n\nexport interface WireEnum {\n readonly [TOKEN_ENUM]: string;\n}\n\nexport function isWireEnum(value: any): value is WireEnum {\n return typeof value === 'object' && value !== null && TOKEN_ENUM in value;\n}\n\nexport interface WireMap {\n readonly [TOKEN_MAP]: { readonly [key: string]: any };\n}\n\nexport function isWireMap(value: any): value is WireMap {\n return typeof value === 'object' && value !== null && TOKEN_MAP in value;\n}\n\nexport interface WireStruct {\n readonly [TOKEN_STRUCT]: {\n readonly fqn: string;\n readonly data: { [key: string]: any };\n };\n}\n\nexport function isWireStruct(value: any): value is WireStruct {\n return typeof value === 'object' && value !== null && TOKEN_STRUCT in value;\n}\n\nexport type Override = MethodOverride | PropertyOverride;\n\nexport interface MethodOverride {\n readonly method: string;\n readonly cookie?: string;\n}\n\nexport function isMethodOverride(value: Override): value is MethodOverride {\n return (value as any).method != null; // Python passes \"null\"\n}\n\nexport interface PropertyOverride {\n readonly property: string;\n readonly cookie?: string;\n}\n\nexport function isPropertyOverride(value: Override): value is PropertyOverride {\n return (value as any).property != null; // Python passes \"null\"\n}\n\nexport interface Callback {\n readonly cbid: string;\n readonly cookie: string | undefined;\n readonly invoke?: InvokeRequest;\n readonly get?: GetRequest;\n readonly set?: SetRequest;\n}\n\nexport interface HelloResponse {\n readonly hello: string;\n}\n\nexport interface LoadRequest {\n /** The name of the assembly */\n readonly name: string;\n\n /** Assembly version */\n readonly version: string;\n\n /** The tarball of the package */\n readonly tarball: string;\n}\n\nexport interface LoadResponse {\n readonly assembly: string;\n readonly types: number;\n}\n\nexport interface InvokeScriptRequest {\n readonly assembly: string;\n readonly script: string;\n readonly args?: string[];\n}\n\nexport interface InvokeScriptResponse {\n readonly status: number | null;\n readonly stdout: Buffer;\n readonly stderr: Buffer;\n readonly signal: string | null;\n}\n\nexport interface CreateRequest {\n /**\n * The FQN of the class of which an instance is requested (or \"Object\")\n */\n readonly fqn: string;\n\n /**\n * The FQNs of interfaces the instance implements, if any. Declaring\n * interfaces that the class denoted by `fqn` implements is not necessary.\n * This means that memebers of interfaces found in this property should\n * declare members that are found in the `overrides` property.\n */\n readonly interfaces?: string[];\n\n /**\n * Arguments to pass to the constructor of `fqn`. (\"Object\" accepts none)\n */\n readonly args?: any[];\n\n /**\n * Declarations of method overrides that should trigger callbacks\n */\n readonly overrides?: Override[];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CreateResponse extends AnnotatedObjRef {}\n\nexport interface DelRequest {\n readonly objref: ObjRef;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface DelResponse {}\n\nexport interface GetRequest {\n readonly objref: ObjRef;\n readonly property: string;\n}\n\nexport interface StaticGetRequest {\n readonly fqn: string;\n readonly property: string;\n}\n\nexport interface GetResponse {\n readonly value: any;\n}\n\nexport interface StaticSetRequest {\n readonly fqn: string;\n readonly property: string;\n readonly value: any;\n}\n\nexport interface SetRequest {\n readonly objref: ObjRef;\n readonly property: string;\n readonly value: any;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface SetResponse {}\n\nexport interface StaticInvokeRequest {\n readonly fqn: string;\n readonly method: string;\n readonly args?: any[];\n}\n\nexport interface InvokeRequest {\n readonly objref: ObjRef;\n readonly method: string;\n readonly args?: any[];\n}\n\nexport interface InvokeResponse {\n readonly result: any;\n}\n\nexport interface BeginRequest {\n readonly objref: ObjRef;\n readonly method: string;\n readonly args?: any[];\n}\n\nexport interface BeginResponse {\n readonly promiseid: string;\n}\n\nexport interface EndRequest {\n readonly promiseid: string;\n}\n\nexport interface EndResponse {\n readonly result: any;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CallbacksRequest {}\n\nexport interface CallbacksResponse {\n readonly callbacks: Callback[];\n}\n\nexport interface CompleteRequest {\n readonly cbid: string;\n readonly err?: string;\n readonly result?: any;\n}\n\nexport interface CompleteResponse {\n readonly cbid: string;\n}\n\nexport interface NamingRequest {\n readonly assembly: string;\n}\n\nexport interface NamingResponse {\n readonly naming: {\n readonly [language: string]: { readonly [key: string]: any } | undefined;\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface StatsRequest {}\n\nexport interface StatsResponse {\n readonly objectCount: number;\n}\n\nexport type KernelRequest =\n | LoadRequest\n | CreateRequest\n | DelRequest\n | GetRequest\n | SetRequest\n | InvokeRequest\n | BeginRequest\n | EndRequest\n | CallbacksRequest\n | CompleteRequest\n | NamingRequest\n | StatsRequest;\n\nexport type KernelResponse =\n | HelloResponse\n | LoadResponse\n | CreateResponse\n | DelResponse\n | GetResponse\n | SetResponse\n | InvokeResponse\n | BeginResponse\n | EndResponse\n | CallbacksResponse\n | CompleteResponse\n | NamingResponse\n | StatsResponse;\n\nexport interface OkayResponse {\n readonly ok: any;\n}\n\nexport interface ErrorResponse {\n readonly error: string;\n readonly stack?: string;\n}\n","export * from './kernel';\n\nimport * as api from './api';\nexport { api };\n","import * as spec from '@jsii/spec';\nimport * as cp from 'child_process';\nimport * as fs from 'fs-extra';\nimport * as os from 'os';\nimport * as path from 'path';\nimport * as tar from 'tar';\nimport * as vm from 'vm';\n\nimport * as api from './api';\nimport { TOKEN_REF } from './api';\nimport { ObjectTable, tagJsiiConstructor } from './objects';\nimport * as onExit from './on-exit';\nimport * as wire from './serialization';\n\nexport class Kernel {\n /**\n * Set to true for verbose debugging.\n */\n public traceEnabled = false;\n\n private assemblies: { [name: string]: Assembly } = {};\n private readonly objects = new ObjectTable(this._typeInfoForFqn.bind(this));\n private cbs: { [cbid: string]: Callback } = {};\n private waiting: { [cbid: string]: Callback } = {};\n private promises: { [prid: string]: AsyncInvocation } = {};\n private nextid = 20000; // incrementing counter for objid, cbid, promiseid\n private syncInProgress?: string; // forbids async calls (begin) while processing sync calls (get/set/invoke)\n private installDir?: string;\n\n private readonly sandbox: vm.Context;\n\n /**\n * Creates a jsii kernel object.\n *\n * @param callbackHandler This handler is invoked when a synchronous callback is called.\n * It's responsibility is to execute the callback and return it's\n * result (or throw an error).\n */\n public constructor(public callbackHandler: (callback: api.Callback) => any) {\n // `setImmediate` is required for tests to pass (it is otherwise\n // impossible to wait for in-VM promises to complete)\n\n // `Buffer` is required when using simple-resource-bundler.\n\n // HACK: when we webpack @jsii/runtime, all \"require\" statements get transpiled,\n // so modules can be resolved within the pack. However, here we actually want to\n // let loaded modules to use the native node \"require\" method.\n // I wonder if webpack has some pragma that allows opting-out at certain points\n // in the code.\n // eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires\n const moduleLoad = require('module').Module._load;\n const nodeRequire = (p: string) => moduleLoad(p, module, false);\n\n this.sandbox = vm.createContext({\n Buffer, // to use simple-resource-bundler\n setImmediate, // async tests\n require: nodeRequire, // modules need to \"require\"\n });\n }\n\n public load(req: api.LoadRequest): api.LoadResponse {\n this._debug('load', req);\n\n if ('assembly' in req) {\n throw new Error(\n '`assembly` field is deprecated for \"load\", use `name`, `version` and `tarball` instead',\n );\n }\n\n const pkgname = req.name;\n const pkgver = req.version;\n\n // check if we already have such a module\n const packageDir = this._getPackageDir(pkgname);\n if (fs.pathExistsSync(packageDir)) {\n // module exists, verify version\n const epkg = fs.readJsonSync(path.join(packageDir, 'package.json'));\n if (epkg.version !== pkgver) {\n throw new Error(\n `Multiple versions ${pkgver} and ${epkg.version} of the ` +\n `package '${pkgname}' cannot be loaded together since this is unsupported by ` +\n 'some runtime environments',\n );\n }\n\n // same version, no-op\n this._debug('look up already-loaded assembly', pkgname);\n const assm = this.assemblies[pkgname];\n\n return {\n assembly: assm.metadata.name,\n types: Object.keys(assm.metadata.types ?? {}).length,\n };\n }\n\n // Create the install directory (there may be several path components for @scoped/packages)\n fs.mkdirpSync(packageDir);\n\n // Force umask to have npm-install-like permissions\n const originalUmask = process.umask(0o022);\n try {\n // untar the archive to its final location\n tar.extract({\n cwd: packageDir,\n file: req.tarball,\n strict: true,\n strip: 1, // Removes the 'package/' path element from entries\n sync: true,\n unlink: true,\n });\n } finally {\n // Reset umask to the initial value\n process.umask(originalUmask);\n }\n\n // read .jsii metadata from the root of the package\n const jsiiMetadataFile = path.join(packageDir, spec.SPEC_FILE_NAME);\n if (!fs.pathExistsSync(jsiiMetadataFile)) {\n throw new Error(\n `Package tarball ${req.tarball} must have a file named ${spec.SPEC_FILE_NAME} at the root`,\n );\n }\n const assmSpec = fs.readJsonSync(jsiiMetadataFile) as spec.Assembly;\n\n // load the module and capture it's closure\n const closure = this._execute(\n `require(String.raw\\`${packageDir}\\`)`,\n packageDir,\n );\n const assm = new Assembly(assmSpec, closure);\n this._addAssembly(assm);\n\n return {\n assembly: assmSpec.name,\n types: Object.keys(assmSpec.types ?? {}).length,\n };\n }\n\n public invokeBinScript(\n req: api.InvokeScriptRequest,\n ): api.InvokeScriptResponse {\n const packageDir = this._getPackageDir(req.assembly);\n if (fs.pathExistsSync(packageDir)) {\n // module exists, verify version\n const epkg = fs.readJsonSync(path.join(packageDir, 'package.json'));\n\n if (!epkg.bin) {\n throw new Error('There is no bin scripts defined for this package.');\n }\n\n const scriptPath = epkg.bin[req.script];\n\n if (!epkg.bin) {\n throw new Error(`Script with name ${req.script} was not defined.`);\n }\n\n const result = cp.spawnSync(\n path.join(packageDir, scriptPath),\n req.args ?? [],\n {\n encoding: 'utf-8',\n env: {\n ...process.env,\n // Make sure the current NODE_OPTIONS are honored if we shell out to node\n NODE_OPTIONS: process.execArgv.join(' '),\n // Make sure \"this\" node is ahead of $PATH just in case\n PATH: `${path.dirname(process.execPath)}:${process.env.PATH}`,\n },\n shell: true,\n },\n );\n\n return {\n stdout: result.stdout,\n stderr: result.stderr,\n status: result.status,\n signal: result.signal,\n };\n }\n throw new Error(`Package with name ${req.assembly} was not loaded.`);\n }\n\n public create(req: api.CreateRequest): api.CreateResponse {\n return this._create(req);\n }\n\n public del(req: api.DelRequest): api.DelResponse {\n const { objref } = req;\n\n this._debug('del', objref);\n this.objects.deleteObject(objref);\n\n return {};\n }\n\n public sget(req: api.StaticGetRequest): api.GetResponse {\n const { fqn, property } = req;\n const symbol = `${fqn}.${property}`;\n this._debug('sget', symbol);\n const ti = this._typeInfoForProperty(property, fqn);\n\n if (!ti.static) {\n throw new Error(`property ${symbol} is not static`);\n }\n\n const prototype = this._findSymbol(fqn);\n\n const value = this._ensureSync(`property ${property}`, () =>\n this._wrapSandboxCode(() => prototype[property]),\n );\n\n this._debug('value:', value);\n const ret = this._fromSandbox(value, ti);\n this._debug('ret', ret);\n return { value: ret };\n }\n\n public sset(req: api.StaticSetRequest): api.SetResponse {\n const { fqn, property, value } = req;\n const symbol = `${fqn}.${property}`;\n this._debug('sset', symbol);\n const ti = this._typeInfoForProperty(property, fqn);\n\n if (!ti.static) {\n throw new Error(`property ${symbol} is not static`);\n }\n\n if (ti.immutable) {\n throw new Error(`static property ${symbol} is readonly`);\n }\n\n const prototype = this._findSymbol(fqn);\n\n this._ensureSync(`property ${property}`, () =>\n this._wrapSandboxCode(\n () => (prototype[property] = this._toSandbox(value, ti)),\n ),\n );\n\n return {};\n }\n\n public get(req: api.GetRequest): api.GetResponse {\n const { objref, property } = req;\n this._debug('get', objref, property);\n const { instance, fqn, interfaces } = this.objects.findObject(objref);\n const ti = this._typeInfoForProperty(property, fqn, interfaces);\n\n // if the property is overridden by the native code and \"get\" is called on the object, it\n // means that the native code is trying to access the \"super\" property. in order to enable\n // that, we actually keep a copy of the original property descriptor when we override,\n // so `findPropertyTarget` will return either the original property name (\"property\") or\n // the \"super\" property name (somehing like \"$jsii$super$$\").\n const propertyToGet = this._findPropertyTarget(instance, property);\n\n // make the actual \"get\", and block any async calls that might be performed\n // by jsii overrides.\n const value = this._ensureSync(\n `property '${objref[TOKEN_REF]}.${propertyToGet}'`,\n () => this._wrapSandboxCode(() => instance[propertyToGet]),\n );\n this._debug('value:', value);\n const ret = this._fromSandbox(value, ti);\n this._debug('ret:', ret);\n return { value: ret };\n }\n\n public set(req: api.SetRequest): api.SetResponse {\n const { objref, property, value } = req;\n this._debug('set', objref, property, value);\n const { instance, fqn, interfaces } = this.objects.findObject(objref);\n\n const propInfo = this._typeInfoForProperty(req.property, fqn, interfaces);\n\n if (propInfo.immutable) {\n throw new Error(\n `Cannot set value of immutable property ${req.property} to ${req.value}`,\n );\n }\n\n const propertyToSet = this._findPropertyTarget(instance, property);\n\n this._ensureSync(`property '${objref[TOKEN_REF]}.${propertyToSet}'`, () =>\n this._wrapSandboxCode(\n () => (instance[propertyToSet] = this._toSandbox(value, propInfo)),\n ),\n );\n\n return {};\n }\n\n public invoke(req: api.InvokeRequest): api.InvokeResponse {\n const { objref, method } = req;\n const args = req.args ?? [];\n\n this._debug('invoke', objref, method, args);\n const { ti, obj, fn } = this._findInvokeTarget(objref, method, args);\n\n // verify this is not an async method\n if (ti.async) {\n throw new Error(`${method} is an async method, use \"begin\" instead`);\n }\n\n const ret = this._ensureSync(\n `method '${objref[TOKEN_REF]}.${method}'`,\n () => {\n return this._wrapSandboxCode(() =>\n fn.apply(obj, this._toSandboxValues(args, ti.parameters)),\n );\n },\n );\n\n const result = this._fromSandbox(ret, ti.returns ?? 'void');\n this._debug('invoke result', result);\n\n return { result };\n }\n\n public sinvoke(req: api.StaticInvokeRequest): api.InvokeResponse {\n const { fqn, method } = req;\n const args = req.args ?? [];\n\n this._debug('sinvoke', fqn, method, args);\n\n const ti = this._typeInfoForMethod(method, fqn);\n\n if (!ti.static) {\n throw new Error(`${fqn}.${method} is not a static method`);\n }\n\n // verify this is not an async method\n if (ti.async) {\n throw new Error(`${method} is an async method, use \"begin\" instead`);\n }\n\n const prototype = this._findSymbol(fqn);\n const fn = prototype[method] as (...params: any[]) => any;\n\n const ret = this._ensureSync(`method '${fqn}.${method}'`, () => {\n return this._wrapSandboxCode(() =>\n fn.apply(prototype, this._toSandboxValues(args, ti.parameters)),\n );\n });\n\n this._debug('method returned:', ret);\n return { result: this._fromSandbox(ret, ti.returns ?? 'void') };\n }\n\n public begin(req: api.BeginRequest): api.BeginResponse {\n const { objref, method } = req;\n const args = req.args ?? [];\n\n this._debug('begin', objref, method, args);\n\n if (this.syncInProgress) {\n throw new Error(\n `Cannot invoke async method '${req.objref[TOKEN_REF]}.${req.method}' while sync ${this.syncInProgress} is being processed`,\n );\n }\n\n const { ti, obj, fn } = this._findInvokeTarget(objref, method, args);\n\n // verify this is indeed an async method\n if (!ti.async) {\n throw new Error(`Method ${method} is expected to be an async method`);\n }\n\n const promise = this._wrapSandboxCode(() =>\n fn.apply(obj, this._toSandboxValues(args, ti.parameters)),\n ) as Promise;\n\n // since we are planning to resolve this promise in a different scope\n // we need to handle rejections here [1]\n // [1]: https://stackoverflow.com/questions/40920179/should-i-refrain-from-handling-promise-rejection-asynchronously/40921505\n promise.catch((_) => undefined);\n\n const prid = this._makeprid();\n this.promises[prid] = {\n promise,\n method: ti,\n };\n\n return { promiseid: prid };\n }\n\n public async end(req: api.EndRequest): Promise {\n const { promiseid } = req;\n\n this._debug('end', promiseid);\n\n const { promise, method } = this.promises[promiseid];\n if (promise == null) {\n throw new Error(`Cannot find promise with ID: ${promiseid}`);\n }\n\n let result;\n try {\n result = await promise;\n this._debug('promise result:', result);\n } catch (e) {\n this._debug('promise error:', e);\n throw e;\n }\n\n return { result: this._fromSandbox(result, method.returns ?? 'void') };\n }\n\n public callbacks(_req?: api.CallbacksRequest): api.CallbacksResponse {\n this._debug('callbacks');\n const ret = Object.keys(this.cbs).map((cbid) => {\n const cb = this.cbs[cbid];\n this.waiting[cbid] = cb; // move to waiting\n const callback: api.Callback = {\n cbid,\n cookie: cb.override.cookie,\n invoke: {\n objref: cb.objref,\n method: cb.override.method,\n args: cb.args,\n },\n };\n return callback;\n });\n\n // move all callbacks to the wait queue and clean the callback queue.\n this.cbs = {};\n return { callbacks: ret };\n }\n\n public complete(req: api.CompleteRequest): api.CompleteResponse {\n const { cbid, err, result } = req;\n\n this._debug('complete', cbid, err, result);\n\n if (!(cbid in this.waiting)) {\n throw new Error(`Callback ${cbid} not found`);\n }\n\n const cb = this.waiting[cbid];\n if (err) {\n this._debug('completed with error:', err);\n cb.fail(new Error(err));\n } else {\n const sandoxResult = this._toSandbox(\n result,\n cb.expectedReturnType ?? 'void',\n );\n this._debug('completed with result:', sandoxResult);\n cb.succeed(sandoxResult);\n }\n\n delete this.waiting[cbid];\n\n return { cbid };\n }\n\n /**\n * Returns the language-specific names for a jsii module.\n * @param assemblyName The name of the jsii module (i.e. jsii$jsii_calculator_lib$)\n */\n public naming(req: api.NamingRequest): api.NamingResponse {\n const assemblyName = req.assembly;\n\n this._debug('naming', assemblyName);\n\n const assembly = this._assemblyFor(assemblyName);\n const targets = assembly.metadata.targets;\n if (!targets) {\n throw new Error(`Unexpected - \"targets\" for ${assemblyName} is missing!`);\n }\n\n return { naming: targets };\n }\n\n public stats(_req?: api.StatsRequest): api.StatsResponse {\n return {\n objectCount: this.objects.count,\n };\n }\n\n private _addAssembly(assm: Assembly) {\n this.assemblies[assm.metadata.name] = assm;\n\n // add the __jsii__.fqn property on every constructor. this allows\n // traversing between the javascript and jsii worlds given any object.\n for (const fqn of Object.keys(assm.metadata.types ?? {})) {\n const typedef = assm.metadata.types![fqn];\n switch (typedef.kind) {\n case spec.TypeKind.Interface:\n continue; // interfaces don't really exist\n case spec.TypeKind.Class:\n case spec.TypeKind.Enum:\n const constructor = this._findSymbol(fqn);\n tagJsiiConstructor(constructor, fqn);\n }\n }\n }\n\n // find the javascript constructor function for a jsii FQN.\n private _findCtor(\n fqn: string,\n args: any[],\n ): { ctor: any; parameters?: spec.Parameter[] } {\n if (fqn === wire.EMPTY_OBJECT_FQN) {\n return { ctor: Object };\n }\n\n const typeinfo = this._typeInfoForFqn(fqn);\n\n switch (typeinfo.kind) {\n case spec.TypeKind.Class:\n const classType = typeinfo as spec.ClassType;\n this._validateMethodArguments(classType.initializer, args);\n return {\n ctor: this._findSymbol(fqn),\n parameters: classType.initializer && classType.initializer.parameters,\n };\n\n case spec.TypeKind.Interface:\n throw new Error(\n `Cannot create an object with an FQN of an interface: ${fqn}`,\n );\n\n default:\n throw new Error(`Unexpected FQN kind: ${fqn}`);\n }\n }\n\n private _getPackageDir(pkgname: string): string {\n if (!this.installDir) {\n this.installDir = fs.mkdtempSync(path.join(os.tmpdir(), 'jsii-kernel-'));\n fs.mkdirpSync(path.join(this.installDir, 'node_modules'));\n this._debug('creating jsii-kernel modules workdir:', this.installDir);\n\n onExit.removeSync(this.installDir);\n }\n return path.join(this.installDir, 'node_modules', pkgname);\n }\n\n // prefixed with _ to allow calling this method internally without\n // getting it recorded for testing.\n private _create(req: api.CreateRequest): api.CreateResponse {\n this._debug('create', req);\n const { fqn, interfaces, overrides } = req;\n\n const requestArgs = req.args ?? [];\n\n const ctorResult = this._findCtor(fqn, requestArgs);\n const ctor = ctorResult.ctor;\n const obj = this._wrapSandboxCode(\n () =>\n new ctor(...this._toSandboxValues(requestArgs, ctorResult.parameters)),\n );\n const objref = this.objects.registerObject(obj, fqn, req.interfaces ?? []);\n\n // overrides: for each one of the override method names, installs a\n // method on the newly created object which represents the remote \"reverse proxy\".\n\n if (overrides) {\n this._debug('overrides', overrides);\n\n const overrideTypeErrorMessage =\n 'Override can either be \"method\" or \"property\"';\n const methods = new Set();\n const properties = new Set();\n\n for (const override of overrides) {\n if (api.isMethodOverride(override)) {\n if (api.isPropertyOverride(override)) {\n throw new Error(overrideTypeErrorMessage);\n }\n if (methods.has(override.method)) {\n throw new Error(\n `Duplicate override for method '${override.method}'`,\n );\n }\n methods.add(override.method);\n\n this._applyMethodOverride(obj, objref, fqn, interfaces, override);\n } else if (api.isPropertyOverride(override)) {\n if (api.isMethodOverride(override)) {\n throw new Error(overrideTypeErrorMessage);\n }\n if (properties.has(override.property)) {\n throw Error(\n `Duplicate override for property '${override.property}'`,\n );\n }\n properties.add(override.property);\n\n this._applyPropertyOverride(obj, objref, fqn, interfaces, override);\n } else {\n throw new Error(overrideTypeErrorMessage);\n }\n }\n }\n\n return objref;\n }\n\n private _getSuperPropertyName(name: string) {\n return `$jsii$super$${name}$`;\n }\n\n private _applyPropertyOverride(\n obj: any,\n objref: api.ObjRef,\n typeFqn: string,\n interfaces: string[] | undefined,\n override: api.PropertyOverride,\n ) {\n // error if we can find a method with this name\n if (this._tryTypeInfoForMethod(override.property, typeFqn, interfaces)) {\n throw new Error(\n `Trying to override method '${override.property}' as a property`,\n );\n }\n\n let propInfo = this._tryTypeInfoForProperty(\n override.property,\n typeFqn,\n interfaces,\n );\n // if this is a private property (i.e. doesn't have `propInfo` the object has a key)\n if (!propInfo && override.property in obj) {\n this._debug(`Skipping override of private property ${override.property}`);\n return;\n }\n\n if (!propInfo) {\n // We've overriding a property on an object we have NO type information on (probably\n // because it's an anonymous object).\n // Pretend it's 'prop: any';\n //\n // FIXME: We could do better type checking during the conversion if JSII clients\n // would tell us the intended interface type.\n propInfo = {\n name: override.property,\n type: spec.CANONICAL_ANY,\n };\n }\n\n this._defineOverridenProperty(obj, objref, override, propInfo);\n }\n\n private _defineOverridenProperty(\n obj: any,\n objref: api.ObjRef,\n override: api.PropertyOverride,\n propInfo: spec.Property,\n ) {\n const propertyName = override.property;\n\n this._debug('apply override', propertyName);\n\n // save the old property under $jsii$super$$ so that property overrides\n // can still access it via `super.`.\n const prev = getPropertyDescriptor(obj, propertyName) ?? {\n value: obj[propertyName],\n writable: true,\n enumerable: true,\n configurable: true,\n };\n\n const prevEnumerable = prev.enumerable;\n prev.enumerable = false;\n Object.defineProperty(obj, this._getSuperPropertyName(propertyName), prev);\n\n // we add callbacks for both 'get' and 'set', even if the property\n // is readonly. this is fine because if you try to set() a readonly\n // property, it will fail.\n Object.defineProperty(obj, propertyName, {\n enumerable: prevEnumerable,\n configurable: prev.configurable,\n get: () => {\n this._debug('virtual get', objref, propertyName, {\n cookie: override.cookie,\n });\n const result = this.callbackHandler({\n cookie: override.cookie,\n cbid: this._makecbid(),\n get: { objref, property: propertyName },\n });\n this._debug('callback returned', result);\n return this._toSandbox(result, propInfo);\n },\n set: (value: any) => {\n this._debug('virtual set', objref, propertyName, {\n cookie: override.cookie,\n });\n this.callbackHandler({\n cookie: override.cookie,\n cbid: this._makecbid(),\n set: {\n objref,\n property: propertyName,\n value: this._fromSandbox(value, propInfo),\n },\n });\n },\n });\n\n function getPropertyDescriptor(\n obj: any,\n propertyName: string,\n ): PropertyDescriptor | undefined {\n const direct = Object.getOwnPropertyDescriptor(obj, propertyName);\n if (direct != null) {\n return direct;\n }\n const proto = Object.getPrototypeOf(obj);\n if (proto == null && proto !== Object.prototype) {\n // We reached Object or the prototype chain root, all hope is lost!\n return undefined;\n }\n return getPropertyDescriptor(proto, propertyName);\n }\n }\n\n private _applyMethodOverride(\n obj: any,\n objref: api.ObjRef,\n typeFqn: string,\n interfaces: string[] | undefined,\n override: api.MethodOverride,\n ) {\n // error if we can find a property with this name\n if (this._tryTypeInfoForProperty(override.method, typeFqn, interfaces)) {\n throw new Error(\n `Trying to override property '${override.method}' as a method`,\n );\n }\n\n let methodInfo = this._tryTypeInfoForMethod(\n override.method,\n typeFqn,\n interfaces,\n );\n\n // If this is a private method (doesn't have methodInfo, key resolves on the object), we\n // are going to skip the override.\n if (!methodInfo && obj[override.method]) {\n this._debug(`Skipping override of private method ${override.method}`);\n return;\n }\n\n if (!methodInfo) {\n // We've overriding a method on an object we have NO type information on (probably\n // because it's an anonymous object).\n // Pretend it's an (...args: any[]) => any\n methodInfo = {\n name: override.method,\n returns: { type: spec.CANONICAL_ANY },\n parameters: [\n {\n name: 'args',\n type: spec.CANONICAL_ANY,\n variadic: true,\n },\n ],\n variadic: true,\n };\n }\n\n this._defineOverridenMethod(obj, objref, override, methodInfo);\n }\n\n private _defineOverridenMethod(\n obj: any,\n objref: api.ObjRef,\n override: api.MethodOverride,\n methodInfo: spec.Method,\n ) {\n const methodName = override.method;\n\n if (methodInfo.async) {\n // async method override\n Object.defineProperty(obj, methodName, {\n enumerable: false,\n configurable: false,\n writable: false,\n value: (...methodArgs: any[]) => {\n this._debug('invoke async method override', override);\n const args = this._toSandboxValues(methodArgs, methodInfo.parameters);\n return new Promise((succeed, fail) => {\n const cbid = this._makecbid();\n this._debug('adding callback to queue', cbid);\n this.cbs[cbid] = {\n objref,\n override,\n args,\n expectedReturnType: methodInfo.returns ?? 'void',\n succeed,\n fail,\n };\n });\n },\n });\n } else {\n // sync method override (method info is not required)\n Object.defineProperty(obj, methodName, {\n enumerable: false,\n configurable: false,\n writable: false,\n value: (...methodArgs: any[]) => {\n this._debug(\n 'invoke sync method override',\n override,\n 'args',\n methodArgs,\n );\n // We should be validating the actual arguments according to the\n // declared parameters here, but let's just assume the JSII runtime on the\n // other end has done its work.\n const result = this.callbackHandler({\n cookie: override.cookie,\n cbid: this._makecbid(),\n invoke: {\n objref,\n method: methodName,\n args: this._fromSandboxValues(methodArgs, methodInfo.parameters),\n },\n });\n this._debug('Result', result);\n return this._toSandbox(result, methodInfo.returns ?? 'void');\n },\n });\n }\n }\n\n private _findInvokeTarget(\n objref: api.ObjRef,\n methodName: string,\n args: any[],\n ) {\n const { instance, fqn, interfaces } = this.objects.findObject(objref);\n const ti = this._typeInfoForMethod(methodName, fqn, interfaces);\n this._validateMethodArguments(ti, args);\n\n // always first look up the method in the prototype. this practically bypasses\n // any methods overridden by derived classes (which are by definition native\n // methods). this serves to allow native call to invoke \"super.method()\" when\n // overriding the method.\n // if we didn't find the method on the prototype, it could be a literal object\n // that implements an interface, so we look if we have the method on the object\n // itself. if we do, we invoke it.\n let fn = instance.constructor.prototype[methodName];\n if (!fn) {\n fn = instance[methodName];\n if (!fn) {\n throw new Error(`Cannot find ${methodName} on object`);\n }\n }\n return { ti, obj: instance, fn };\n }\n\n private _validateMethodArguments(\n method: spec.Callable | undefined,\n args: any[],\n ) {\n const params: spec.Parameter[] = method?.parameters ?? [];\n\n // error if args > params\n if (args.length > params.length && !(method && method.variadic)) {\n throw new Error(\n `Too many arguments (method accepts ${params.length} parameters, got ${args.length} arguments)`,\n );\n }\n\n for (let i = 0; i < params.length; ++i) {\n const param = params[i];\n const arg = args[i];\n\n if (param.variadic) {\n if (params.length <= i) {\n return;\n } // No vararg was provided\n for (let j = i; j < params.length; j++) {\n if (!param.optional && params[j] === undefined) {\n throw new Error(\n `Unexpected 'undefined' value at index ${\n j - i\n } of variadic argument '${\n param.name\n }' of type '${spec.describeTypeReference(param.type)}'`,\n );\n }\n }\n } else if (!param.optional && arg === undefined) {\n throw new Error(\n `Not enough arguments. Missing argument for the required parameter '${\n param.name\n }' of type '${spec.describeTypeReference(param.type)}'`,\n );\n }\n }\n }\n\n private _assemblyFor(assemblyName: string) {\n const assembly = this.assemblies[assemblyName];\n if (!assembly) {\n throw new Error(`Could not find assembly: ${assemblyName}`);\n }\n return assembly;\n }\n\n private _findSymbol(fqn: string) {\n const [assemblyName, ...parts] = fqn.split('.');\n const assembly = this._assemblyFor(assemblyName);\n\n let curr = assembly.closure;\n while (parts.length > 0) {\n const name = parts.shift();\n if (!name) {\n break;\n }\n\n curr = curr[name];\n }\n if (!curr) {\n throw new Error(`Could not find symbol ${fqn}`);\n }\n return curr;\n }\n\n private _typeInfoForFqn(fqn: string): spec.Type {\n const components = fqn.split('.');\n const moduleName = components[0];\n\n const assembly = this.assemblies[moduleName];\n if (!assembly) {\n throw new Error(`Module '${moduleName}' not found`);\n }\n\n const types = assembly.metadata.types ?? {};\n const fqnInfo = types[fqn];\n if (!fqnInfo) {\n throw new Error(`Type '${fqn}' not found`);\n }\n\n return fqnInfo;\n }\n\n private _typeInfoForMethod(\n methodName: string,\n fqn: string,\n interfaces?: string[],\n ): spec.Method {\n const ti = this._tryTypeInfoForMethod(methodName, fqn, interfaces);\n if (!ti) {\n const addendum =\n interfaces && interfaces.length > 0\n ? ` or interface(s) ${interfaces.join(', ')}`\n : '';\n throw new Error(\n `Class ${fqn}${addendum} doesn't have a method '${methodName}'`,\n );\n }\n return ti;\n }\n\n private _tryTypeInfoForMethod(\n methodName: string,\n classFqn: string,\n interfaces: string[] = [],\n ): spec.Method | undefined {\n for (const fqn of [classFqn, ...interfaces]) {\n if (fqn === 'Object') {\n continue;\n }\n const typeinfo = this._typeInfoForFqn(fqn);\n\n const methods =\n (typeinfo as spec.ClassType | spec.InterfaceType).methods ?? [];\n\n for (const m of methods) {\n if (m.name === methodName) {\n return m;\n }\n }\n\n // recursion to parent type (if exists)\n const bases = [\n (typeinfo as spec.ClassType).base,\n ...((typeinfo as spec.InterfaceType).interfaces ?? []),\n ];\n for (const base of bases) {\n if (!base) {\n continue;\n }\n\n const found = this._tryTypeInfoForMethod(methodName, base);\n if (found) {\n return found;\n }\n }\n }\n\n return undefined;\n }\n\n private _tryTypeInfoForProperty(\n property: string,\n classFqn: string,\n interfaces: string[] = [],\n ): spec.Property | undefined {\n for (const fqn of [classFqn, ...interfaces]) {\n if (fqn === wire.EMPTY_OBJECT_FQN) {\n continue;\n }\n const typeInfo = this._typeInfoForFqn(fqn);\n\n let properties;\n let bases;\n\n if (spec.isClassType(typeInfo)) {\n const classTypeInfo = typeInfo as spec.ClassType;\n properties = classTypeInfo.properties;\n bases = classTypeInfo.base ? [classTypeInfo.base] : [];\n } else if (spec.isInterfaceType(typeInfo)) {\n const interfaceTypeInfo = typeInfo as spec.InterfaceType;\n properties = interfaceTypeInfo.properties;\n bases = interfaceTypeInfo.interfaces ?? [];\n } else {\n throw new Error(\n `Type of kind ${typeInfo.kind} does not have properties`,\n );\n }\n\n for (const p of properties ?? []) {\n if (p.name === property) {\n return p;\n }\n }\n\n // recurse to parent type (if exists)\n for (const baseFqn of bases) {\n const ret = this._tryTypeInfoForProperty(property, baseFqn);\n if (ret) {\n return ret;\n }\n }\n }\n\n return undefined;\n }\n\n private _typeInfoForProperty(\n property: string,\n fqn: string,\n interfaces?: string[],\n ): spec.Property {\n const typeInfo = this._tryTypeInfoForProperty(property, fqn, interfaces);\n if (!typeInfo) {\n const addendum =\n interfaces && interfaces.length > 0\n ? ` or interface(s) ${interfaces.join(', ')}`\n : '';\n throw new Error(\n `Type ${fqn}${addendum} doesn't have a property '${property}'`,\n );\n }\n return typeInfo;\n }\n\n private _toSandbox(v: any, expectedType: wire.OptionalValueOrVoid): any {\n const serTypes = wire.serializationType(\n expectedType,\n this._typeInfoForFqn.bind(this),\n );\n this._debug('toSandbox', v, JSON.stringify(serTypes));\n\n const host: wire.SerializerHost = {\n objects: this.objects,\n debug: this._debug.bind(this),\n findSymbol: this._findSymbol.bind(this),\n lookupType: this._typeInfoForFqn.bind(this),\n recurse: this._toSandbox.bind(this),\n };\n\n const errors = new Array();\n for (const { serializationClass, typeRef } of serTypes) {\n try {\n return wire.SERIALIZERS[serializationClass].deserialize(\n v,\n typeRef,\n host,\n );\n } catch (e) {\n // If no union (99% case), rethrow immediately to preserve stack trace\n if (serTypes.length === 1) {\n throw e;\n }\n errors.push(e.message);\n }\n }\n\n throw new Error(\n `Value did not match any type in union: ${errors.join(', ')}`,\n );\n }\n\n private _fromSandbox(v: any, targetType: wire.OptionalValueOrVoid): any {\n const serTypes = wire.serializationType(\n targetType,\n this._typeInfoForFqn.bind(this),\n );\n this._debug('fromSandbox', v, JSON.stringify(serTypes));\n\n const host: wire.SerializerHost = {\n objects: this.objects,\n debug: this._debug.bind(this),\n findSymbol: this._findSymbol.bind(this),\n lookupType: this._typeInfoForFqn.bind(this),\n recurse: this._fromSandbox.bind(this),\n };\n\n const errors = new Array();\n for (const { serializationClass, typeRef } of serTypes) {\n try {\n return wire.SERIALIZERS[serializationClass].serialize(v, typeRef, host);\n } catch (e) {\n // If no union (99% case), rethrow immediately to preserve stack trace\n if (serTypes.length === 1) {\n throw e;\n }\n errors.push(e.message);\n }\n }\n\n throw new Error(\n `Value did not match any type in union: ${errors.join(', ')}`,\n );\n }\n\n private _toSandboxValues(xs: any[], parameters?: spec.Parameter[]) {\n return this._boxUnboxParameters(xs, parameters, this._toSandbox.bind(this));\n }\n\n private _fromSandboxValues(xs: any[], parameters?: spec.Parameter[]) {\n return this._boxUnboxParameters(\n xs,\n parameters,\n this._fromSandbox.bind(this),\n );\n }\n\n private _boxUnboxParameters(\n xs: any[],\n parameters: spec.Parameter[] | undefined,\n boxUnbox: (x: any, t: wire.OptionalValueOrVoid) => any,\n ) {\n parameters = [...(parameters ?? [])];\n const variadic =\n parameters.length > 0 && !!parameters[parameters.length - 1].variadic;\n // Repeat the last (variadic) type to match the number of actual arguments\n while (variadic && parameters.length < xs.length) {\n parameters.push(parameters[parameters.length - 1]);\n }\n if (xs.length > parameters.length) {\n throw new Error(\n `Argument list (${JSON.stringify(\n xs,\n )}) not same size as expected argument list (length ${\n parameters.length\n })`,\n );\n }\n return xs.map((x, i) => boxUnbox(x, parameters![i]));\n }\n\n private _debug(...args: any[]) {\n if (this.traceEnabled) {\n console.error('[@jsii/kernel]', ...args);\n }\n }\n\n /**\n * Ensures that `fn` is called and defends against beginning to invoke\n * async methods until fn finishes (successfully or not).\n */\n private _ensureSync(desc: string, fn: () => T): T {\n this.syncInProgress = desc;\n try {\n return fn();\n } finally {\n delete this.syncInProgress;\n }\n }\n\n private _findPropertyTarget(obj: any, property: string) {\n const superProp = this._getSuperPropertyName(property);\n if (superProp in obj) {\n return superProp;\n }\n return property;\n }\n\n //\n // type information\n //\n\n private _makecbid() {\n return `jsii::callback::${this.nextid++}`;\n }\n\n private _makeprid() {\n return `jsii::promise::${this.nextid++}`;\n }\n\n private _wrapSandboxCode(fn: () => T): T {\n return fn();\n }\n\n /**\n * Executes arbitrary code in a VM sandbox.\n *\n * @param code JavaScript code to be executed in the VM\n * @param sandbox a VM context to use for running the code\n * @param sourceMaps source maps to be used in case an exception is thrown\n * @param filename the file name to use for the executed code\n *\n * @returns the result of evaluating the code\n */\n private _execute(code: string, filename: string) {\n const script = new vm.Script(code, { filename });\n return script.runInContext(this.sandbox, { displayErrors: true });\n }\n}\n\ninterface Callback {\n objref: api.ObjRef;\n override: api.MethodOverride;\n args: any[];\n expectedReturnType: wire.OptionalValueOrVoid;\n\n // completion callbacks\n succeed: (...args: any[]) => any;\n fail: (...args: any[]) => any;\n}\n\ninterface AsyncInvocation {\n method: spec.Method;\n promise: Promise;\n}\n\nclass Assembly {\n public constructor(\n public readonly metadata: spec.Assembly,\n public readonly closure: any,\n ) {}\n}\n","import * as spec from '@jsii/spec';\n\nimport * as api from './api';\nimport { EMPTY_OBJECT_FQN } from './serialization';\n\n/**\n * Symbol under which we store the { type -> objid } map on object instances\n */\nconst OBJID_SYMBOL = Symbol.for('$__jsii__objid__$');\n\n/**\n * Symbol under which we store the interfaces implemented by instances\n */\nconst IFACES_SYMBOL = Symbol.for('$__jsii__interfaces__$');\n\n/**\n * Symbol we use to tag the constructor of a JSII class\n */\nconst JSII_SYMBOL = Symbol.for('__jsii__');\n\n/**\n * Get the JSII fqn for an object (if available)\n *\n * This will return something if the object was constructed from a JSII-enabled\n * class/constructor, or if a literal object was annotated with type\n * information.\n */\nexport function jsiiTypeFqn(obj: any): string | undefined {\n return obj.constructor[JSII_SYMBOL]?.fqn;\n}\n\n/**\n * If this object was previously serialized under a given reference, return the same reference\n *\n * This is to retain object identity across invocations.\n */\nexport function objectReference(obj: unknown): api.AnnotatedObjRef | undefined {\n // If this object as already returned\n if ((obj as any)[OBJID_SYMBOL]) {\n return {\n [api.TOKEN_REF]: (obj as ManagedObject)[OBJID_SYMBOL],\n [api.TOKEN_INTERFACES]: (obj as ManagedObject)[IFACES_SYMBOL],\n };\n }\n\n return undefined;\n}\n\ntype ManagedObject = {\n [OBJID_SYMBOL]: string;\n [IFACES_SYMBOL]?: string[];\n};\n\nfunction tagObject(obj: unknown, objid: string, interfaces?: string[]) {\n const managed = obj as ManagedObject;\n managed[OBJID_SYMBOL] = objid;\n managed[IFACES_SYMBOL] = interfaces;\n}\n\n/**\n * Set the JSII FQN for classes produced by a given constructor\n */\nexport function tagJsiiConstructor(constructor: any, fqn: string) {\n Object.defineProperty(constructor, JSII_SYMBOL, {\n configurable: false,\n enumerable: false,\n writable: false,\n value: { fqn },\n });\n}\n\n/**\n * Table of JSII objects\n *\n * There can be multiple references to the same object, each under a different requested\n * type.\n */\nexport class ObjectTable {\n private objects: { [objid: string]: RegisteredObject } = {};\n private nextid = 10000;\n\n public constructor(\n private readonly resolveType: (fqn: string) => spec.Type,\n ) {}\n\n /**\n * Register the given object with the given type\n *\n * Return the existing registration if available.\n */\n public registerObject(\n obj: unknown,\n fqn: string,\n interfaces?: string[],\n ): api.AnnotatedObjRef {\n if (fqn === undefined) {\n throw new Error('FQN cannot be undefined');\n }\n\n const existingRef = objectReference(obj);\n if (existingRef) {\n if (interfaces) {\n const allIfaces = new Set(interfaces);\n for (const iface of existingRef[api.TOKEN_INTERFACES] ?? []) {\n allIfaces.add(iface);\n }\n this.objects[existingRef[api.TOKEN_REF]].interfaces = (obj as any)[\n IFACES_SYMBOL\n ] = existingRef[\n api.TOKEN_INTERFACES\n ] = interfaces = this.removeRedundant(Array.from(allIfaces), fqn);\n }\n return existingRef;\n }\n\n interfaces = this.removeRedundant(interfaces, fqn);\n\n const objid = this.makeId(fqn);\n this.objects[objid] = { instance: obj, fqn, interfaces };\n tagObject(obj, objid, interfaces);\n\n return { [api.TOKEN_REF]: objid, [api.TOKEN_INTERFACES]: interfaces };\n }\n\n /**\n * Find the object and registered type for the given ObjRef\n */\n public findObject(objref: api.ObjRef): RegisteredObject {\n if (typeof objref !== 'object' || !(api.TOKEN_REF in objref)) {\n throw new Error(`Malformed object reference: ${JSON.stringify(objref)}`);\n }\n\n const objid = objref[api.TOKEN_REF];\n const obj = this.objects[objid];\n if (!obj) {\n throw new Error(`Object ${objid} not found`);\n }\n return obj;\n }\n\n /**\n * Delete the registration with the given objref\n */\n public deleteObject(objref: api.ObjRef) {\n this.findObject(objref); // make sure object exists\n delete this.objects[objref[api.TOKEN_REF]];\n }\n\n public get count(): number {\n return Object.keys(this.objects).length;\n }\n\n private makeId(fqn: string) {\n return `${fqn}@${this.nextid++}`;\n }\n\n private removeRedundant(\n interfaces: string[] | undefined,\n fqn: string,\n ): string[] | undefined {\n if (!interfaces || interfaces.length === 0) {\n return undefined;\n }\n\n const result = new Set(interfaces);\n const builtIn = new InterfaceCollection(this.resolveType);\n\n if (fqn !== EMPTY_OBJECT_FQN) {\n builtIn.addFromClass(fqn);\n }\n interfaces.forEach(builtIn.addFromInterface.bind(builtIn));\n\n for (const iface of builtIn) {\n result.delete(iface);\n }\n\n return result.size > 0 ? Array.from(result).sort() : undefined;\n }\n}\n\nexport interface RegisteredObject {\n instance: any;\n fqn: string;\n interfaces?: string[];\n}\n\nclass InterfaceCollection implements Iterable {\n private readonly interfaces = new Set();\n\n public constructor(\n private readonly resolveType: (fqn: string) => spec.Type,\n ) {}\n\n public addFromClass(fqn: string): void {\n const ti = this.resolveType(fqn);\n if (!spec.isClassType(ti)) {\n throw new Error(\n `Expected a class, but received ${spec.describeTypeReference(ti)}`,\n );\n }\n if (ti.base) {\n this.addFromClass(ti.base);\n }\n if (ti.interfaces) {\n for (const iface of ti.interfaces) {\n if (this.interfaces.has(iface)) {\n continue;\n }\n this.interfaces.add(iface);\n this.addFromInterface(iface);\n }\n }\n }\n\n public addFromInterface(fqn: string): void {\n const ti = this.resolveType(fqn);\n if (!spec.isInterfaceType(ti)) {\n throw new Error(\n `Expected an interface, but received ${spec.describeTypeReference(ti)}`,\n );\n }\n if (!ti.interfaces) {\n return;\n }\n for (const iface of ti.interfaces) {\n if (this.interfaces.has(iface)) {\n continue;\n }\n this.interfaces.add(iface);\n this.addFromInterface(iface);\n }\n }\n\n public [Symbol.iterator]() {\n return this.interfaces[Symbol.iterator]();\n }\n}\n","import * as fs from 'fs-extra';\nimport * as process from 'process';\n\nconst removeSyncPaths = new Array();\n\nexport function removeSync(path: string): void {\n registerIfNeeded();\n removeSyncPaths.push(path);\n}\n\nlet registered = false;\n\n/**\n * Registers the exist handler if it has not been registered already. This is done exactly ocne per\n * process, so that processes with multiple kernels don't end up creating too many exit handlers, as\n * this reduces the chances they will correctly run.\n */\nfunction registerIfNeeded() {\n if (registered) {\n return;\n }\n process.once('exit', onExitHandler);\n registered = true;\n\n function onExitHandler() {\n if (removeSyncPaths.length > 0) {\n for (const path of removeSyncPaths) {\n fs.removeSync(path);\n }\n }\n }\n}\n","/**\n * Handling of types in JSII\n *\n * Types will be serialized according to the following table:\n *\n * ┬───────────────────────────────────────────────────────────────────────────────────────────────┐\n * │ JAVASCRIPT TYPE │\n * ┼────────────────┬───────────┬────────────┬───────────────┬───────────────────┬─────────────────┤\n * │ undefined/null │ date │ scalar (*) │ array │ JSII-class object │ literal object │\n * ├──────────┼────────────┼────────────────┼───────────┼────────────┼───────────────┼───────────────────┼─────────────────┤\n * │ DECLARED │ void │ undefined │ undefined │ undefined │ undefined │ undefined │ undefined │\n * │ TYPE │ date │ undefined(†) │ { date } │ - │ - │ - │ - │\n * │ │ scalar (*) │ undefined(†) │ - │ value │ - │ - │ - │\n * │ │ json │ undefined │ string │ value │ array/R(json) │ - │ byvalue/R(json) │\n * │ │ enum │ undefined(†) │ - │ { enum } │ - │ - │ - │\n * │ │ array of T │ undefined(†) │ - │ - │ array/R(T) │ - │ - │\n * │ │ map of T │ undefined(†) │ - │ - │ - │ - │ byvalue/R(T) │\n * │ │ interface │ undefined(†) │ - │ - │ - │ { ref } │ { ref: proxy } │\n * │ │ struct │ undefined(†) │ - │ - │ - │ - │ byvalue/R(T[k]) │\n * │ │ class │ undefined(†) │ - │ - │ - │ { ref } │ { ref: proxy } │\n * │ │ any │ undefined │ { date } │ value │ array/R(any) │ { ref } │ byvalue/R(any) │\n * └──────────┴────────────┴────────────────┴───────────┴────────────┴───────────────┴───────────────────┴─────────────────┘\n *\n * - (*) scalar means 'string | number | boolean'\n * - (†) throw if not nullable\n * - /R(t) recurse with declared type t\n */\n\nimport * as spec from '@jsii/spec';\n\nimport {\n isObjRef,\n isWireDate,\n isWireEnum,\n isWireMap,\n ObjRef,\n TOKEN_DATE,\n TOKEN_ENUM,\n TOKEN_MAP,\n WireDate,\n WireEnum,\n isWireStruct,\n TOKEN_STRUCT,\n} from './api';\nimport { jsiiTypeFqn, objectReference, ObjectTable } from './objects';\n\nimport { api } from '.';\n\n/**\n * A specific singleton type to be explicit about a Void type\n *\n * In the spec, 'void' is represented as 'undefined'(*), but allowing the\n * value 'undefined' in function calls has lead to consumers failing to pass\n * type information that they had, just because they didn't \"have to\" (the\n * parameter was optional).\n *\n * (*) As in, declaration of a method looks like { returns?: TypeReference }\n * and the absence of a type means it returns 'void'.\n */\nexport type Void = 'void';\n\n/**\n * A type instance, or Void\n */\nexport type OptionalValueOrVoid = spec.OptionalValue | Void;\n\n/**\n * A special FQN that can be used to create empty javascript objects.\n */\nexport const EMPTY_OBJECT_FQN = 'Object';\n\nexport const SYMBOL_WIRE_TYPE = Symbol.for('$jsii$wireType$');\n\n/**\n * The type kind, that controls how it will be serialized according to the above table\n */\nexport const enum SerializationClass {\n Void = 'Void',\n Date = 'Date',\n Scalar = 'Scalar',\n Json = 'Json',\n Enum = 'Enum',\n Array = 'Array',\n Map = 'Map',\n Struct = 'Struct',\n ReferenceType = 'RefType',\n Any = 'Any',\n}\n\ntype TypeLookup = (fqn: spec.FQN) => spec.Type;\ntype SymbolLookup = (fqn: spec.FQN) => any;\n\nexport interface SerializerHost {\n readonly objects: ObjectTable;\n debug(...args: any[]): void;\n lookupType(fqn: string): spec.Type;\n recurse(x: any, type: OptionalValueOrVoid): any;\n findSymbol(fqn: spec.FQN): any;\n}\n\ninterface Serializer {\n serialize(\n value: unknown,\n type: OptionalValueOrVoid,\n host: SerializerHost,\n ): any;\n deserialize(\n value: unknown,\n type: OptionalValueOrVoid,\n host: SerializerHost,\n ): any;\n}\n\nexport const SERIALIZERS: { [k: string]: Serializer } = {\n // ----------------------------------------------------------------------\n [SerializationClass.Void]: {\n serialize(value, _type, host) {\n if (value != null) {\n host.debug('Expected void, got', value);\n }\n return undefined;\n },\n\n deserialize(value, _type, host) {\n if (value != null) {\n host.debug('Expected void, got', value);\n }\n return undefined;\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Date]: {\n serialize(value, optionalValue): WireDate | undefined {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (!isDate(value)) {\n throw new Error(`Expected Date, got ${JSON.stringify(value)}`);\n }\n return serializeDate(value);\n },\n\n deserialize(value, optionalValue) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n\n if (!isWireDate(value)) {\n throw new Error(`Expected Date, got ${JSON.stringify(value)}`);\n }\n return deserializeDate(value);\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Scalar]: {\n serialize(value, optionalValue) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n const primitiveType = optionalValue.type as spec.PrimitiveTypeReference;\n\n if (!isScalar(value)) {\n throw new Error(\n `Expected ${spec.describeTypeReference(\n optionalValue.type,\n )}, got ${JSON.stringify(value)}`,\n );\n }\n if (typeof value !== primitiveType.primitive) {\n throw new Error(\n `Expected a ${spec.describeTypeReference(\n optionalValue.type,\n )}, got ${JSON.stringify(value)} (${typeof value})`,\n );\n }\n return value;\n },\n\n deserialize(value, optionalValue) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n const primitiveType = optionalValue.type as spec.PrimitiveTypeReference;\n\n if (!isScalar(value)) {\n throw new Error(\n `Expected a ${spec.describeTypeReference(\n optionalValue.type,\n )}, got ${JSON.stringify(value)}`,\n );\n }\n if (typeof value !== primitiveType.primitive) {\n throw new Error(\n `Expected a ${spec.describeTypeReference(\n optionalValue.type,\n )}, got ${JSON.stringify(value)} (${typeof value})`,\n );\n }\n\n return value;\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Json]: {\n serialize(value) {\n // Just whatever. Dates will automatically serialize themselves to strings.\n return value;\n },\n deserialize(value, optionalValue, host) {\n // /!\\ Top-level \"null\" will turn to undefined, but any null nested in the value is valid JSON, so it'll stay!\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n\n // A mapping object can arrive though here. This would be the case if anything that is valid into a Map\n // is passed into a JSON transfer point. Indeed, those are also valid JSON! For example, Python \"dicts\" will be\n // serialized (by the Python runtime) as a $jsii.map (the mapping object). We need to de-serialize that as a\n // Map in order to obtain the correct output behavior here!\n if (isWireMap(value)) {\n return SERIALIZERS[SerializationClass.Map].deserialize(\n value,\n {\n optional: false,\n type: {\n collection: {\n kind: spec.CollectionKind.Map,\n elementtype: { primitive: spec.PrimitiveType.Json },\n },\n },\n },\n host,\n );\n }\n\n if (typeof value !== 'object') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map(mapJsonValue);\n }\n\n return mapValues(value, mapJsonValue);\n\n function mapJsonValue(toMap: any) {\n if (toMap == null) {\n return toMap;\n }\n return host.recurse(toMap, {\n type: { primitive: spec.PrimitiveType.Json },\n });\n }\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Enum]: {\n serialize(value, optionalValue, host): WireEnum | undefined {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (typeof value !== 'string' && typeof value !== 'number') {\n throw new Error(`Expected enum value, got ${JSON.stringify(value)}`);\n }\n\n host.debug('Serializing enum');\n\n const enumType = optionalValue.type as spec.NamedTypeReference;\n const enumMap = host.findSymbol(enumType.fqn);\n const enumEntry = Object.entries(enumMap).find(([, v]) => v === value);\n if (!enumEntry) {\n throw new Error(`No entry in ${enumType.fqn} has value ${value}`);\n }\n return { [TOKEN_ENUM]: `${enumType.fqn}/${enumEntry[0]}` };\n },\n deserialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n\n if (!isWireEnum(value)) {\n throw new Error(`Expected enum value, got ${JSON.stringify(value)}`);\n }\n\n return deserializeEnum(value, host.findSymbol);\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Array]: {\n serialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (!Array.isArray(value)) {\n throw new Error(`Expected array type, got ${JSON.stringify(value)}`);\n }\n\n const arrayType = optionalValue.type as spec.CollectionTypeReference;\n\n return value.map((x) =>\n host.recurse(x, { type: arrayType.collection.elementtype }),\n );\n },\n deserialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (!Array.isArray(value)) {\n throw new Error(`Expected array type, got ${JSON.stringify(value)}`);\n }\n\n const arrayType = optionalValue.type as spec.CollectionTypeReference;\n\n return value.map((x) =>\n host.recurse(x, { type: arrayType.collection.elementtype }),\n );\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Map]: {\n serialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n const mapType = optionalValue.type as spec.CollectionTypeReference;\n return {\n [TOKEN_MAP]: mapValues(value, (v) =>\n host.recurse(v, { type: mapType.collection.elementtype }),\n ),\n };\n },\n deserialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n const mapType = optionalValue.type as spec.CollectionTypeReference;\n if (!isWireMap(value)) {\n // Compatibility mode with older versions that didn't wrap in [TOKEN_MAP]\n return mapValues(value, (v) =>\n host.recurse(v, { type: mapType.collection.elementtype }),\n );\n }\n const result = mapValues(value[TOKEN_MAP], (v) =>\n host.recurse(v, { type: mapType.collection.elementtype }),\n );\n Object.defineProperty(result, SYMBOL_WIRE_TYPE, {\n configurable: false,\n enumerable: false,\n value: TOKEN_MAP,\n writable: false,\n });\n return result;\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Struct]: {\n serialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (typeof value !== 'object' || value == null) {\n throw new Error(`Expected object, got ${JSON.stringify(value)}`);\n }\n\n /*\n This is what we'd like to do, but we can't because at least the Java client\n does not understand by-value serialized interface types, so we'll have to\n serialize by-reference. Additionally, serializing known properties would\n cause problems when the return type of a method is a UNION of structs.\n See: https://github.com/aws/jsii/issues/400\n\n const props = propertiesOf(namedType);\n\n return mapValues(value, (v, key) => {\n if (!props[key]) { return undefined; } // Don't map if unknown property\n return host.recurse(v, props[key].type);\n });\n */\n\n host.debug('Returning value type by reference');\n return host.objects.registerObject(value, 'Object', [\n (optionalValue.type as spec.NamedTypeReference).fqn,\n ]);\n },\n deserialize(value, optionalValue, host) {\n if (typeof value === 'object' && Object.keys(value ?? {}).length === 0) {\n // Treat empty structs as `undefined` (see https://github.com/aws/jsii/issues/411)\n value = undefined;\n }\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (typeof value !== 'object' || value == null) {\n throw new Error(\n `Expected object reference, got ${JSON.stringify(value)}`,\n );\n }\n\n const namedType = host.lookupType(\n (optionalValue.type as spec.NamedTypeReference).fqn,\n );\n const props = propertiesOf(namedType, host.lookupType);\n\n if (Array.isArray(value)) {\n throw new Error(\n `Got an array where a ${namedType.fqn} was expected. Did you mean to pass a variable number of arguments?`,\n );\n }\n\n // Similarly to serialization, we might be getting a reference type where we're\n // expecting a value type. Accept this for now (but also validate that object\n // for presence of the right properties).\n if (isObjRef(value)) {\n host.debug(\n 'Expected value type but got reference type, accepting for now (awslabs/jsii#400)',\n );\n\n // Return same INSTANCE (shouldn't matter but we don't know for sure that it doesn't)\n return validateRequiredProps(\n host.objects.findObject(value).instance,\n namedType.fqn,\n props,\n );\n }\n\n if (api.isWireStruct(value)) {\n const { fqn, data } = value[api.TOKEN_STRUCT];\n if (!isAssignable(fqn, namedType, host.lookupType)) {\n throw new Error(\n `Wire struct type '${fqn}' does not match expected '${namedType.fqn}'`,\n );\n }\n value = data;\n }\n\n // Python, for example, allows using plain mapping objects instead of Structs (dyanmic typing, YOLO!)\n if (api.isWireMap(value)) {\n value = value[api.TOKEN_MAP];\n }\n\n value = validateRequiredProps(value as any, namedType.fqn, props);\n\n // Return a dict COPY, we have by-value semantics anyway.\n return mapValues(value, (v, key) => {\n if (!props[key]) {\n return undefined;\n } // Don't map if unknown property\n return host.recurse(v, props[key]);\n });\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.ReferenceType]: {\n serialize(value, optionalValue, host): ObjRef | undefined {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (typeof value !== 'object' || value == null) {\n throw new Error(\n `Expected object reference, got ${JSON.stringify(value)}`,\n );\n }\n\n const expectedType = host.lookupType(\n (optionalValue.type as spec.NamedTypeReference).fqn,\n );\n const interfaces = spec.isInterfaceType(expectedType)\n ? [expectedType.fqn]\n : undefined;\n const jsiiType =\n jsiiTypeFqn(value) ??\n (spec.isClassType(expectedType) ? expectedType.fqn : 'Object');\n\n return host.objects.registerObject(value, jsiiType, interfaces);\n },\n deserialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n // The only way to pass a by-ref object is to have created it\n // previously inside JSII kernel, so it must have an objref already.\n\n if (!isObjRef(value)) {\n throw new Error(\n `Expected object reference, got ${JSON.stringify(value)}`,\n );\n }\n\n const { instance, fqn } = host.objects.findObject(value);\n\n const namedTypeRef = optionalValue.type as spec.NamedTypeReference;\n if (namedTypeRef.fqn !== EMPTY_OBJECT_FQN) {\n const namedType = host.lookupType(namedTypeRef.fqn);\n\n // Check that the object we got is of the right type\n // We only do this for classes, not interfaces, since Java might pass us objects that\n // privately implement some interface and we can't prove they don't.\n // https://github.com/aws/jsii/issues/399\n const declaredType = optionalValue.type as spec.NamedTypeReference;\n if (\n spec.isClassType(namedType) &&\n !isAssignable(fqn, declaredType, host.lookupType)\n ) {\n throw new Error(\n `Object of type ${fqn} is not convertible to ${declaredType.fqn}`,\n );\n }\n }\n\n return instance;\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Any]: {\n serialize(value, _type, host) {\n if (value == null) {\n return undefined;\n }\n\n if (isDate(value)) {\n return serializeDate(value);\n }\n if (isScalar(value)) {\n return value;\n }\n if (Array.isArray(value)) {\n return value.map((e) => host.recurse(e, { type: spec.CANONICAL_ANY }));\n }\n\n // Note: no case for \"ENUM\" here, without type declaration we can't tell the difference\n // between an enum member and a scalar.\n\n if (typeof value === 'function') {\n throw new Error(\n 'JSII Kernel is unable to serialize `function`. An instance with methods might have been returned by an `any` method?',\n );\n }\n\n if (typeof value !== 'object' || value == null) {\n throw new Error(\n `JSII kernel assumption violated, ${JSON.stringify(\n value,\n )} is not an object`,\n );\n }\n\n if (\n SYMBOL_WIRE_TYPE in value &&\n (value as any)[SYMBOL_WIRE_TYPE] === TOKEN_MAP\n ) {\n return SERIALIZERS[SerializationClass.Map].serialize(\n value,\n {\n type: {\n collection: {\n kind: spec.CollectionKind.Map,\n elementtype: spec.CANONICAL_ANY,\n },\n },\n },\n host,\n );\n }\n\n // To make sure people aren't going to try and return Map<> or Set<> out, test for\n // those and throw a descriptive error message. We can't detect these cases any other\n // way, and the by-value serialized object will be quite useless.\n if (value instanceof Set || value instanceof Map) {\n throw new Error(\"Can't return objects of type Set or Map\");\n }\n\n // Use a previous reference to maintain object identity. NOTE: this may cause us to return\n // a different type than requested! This is just how it is right now.\n // https://github.com/aws/jsii/issues/399\n const prevRef = objectReference(value);\n if (prevRef) {\n return prevRef;\n }\n\n // If this is or should be a reference type, pass or make the reference\n // (Like regular reftype serialization, but without the type derivation to an interface)\n const jsiiType =\n jsiiTypeFqn(value) ??\n (isByReferenceOnly(value) ? EMPTY_OBJECT_FQN : undefined);\n if (jsiiType) {\n return host.objects.registerObject(value, jsiiType);\n }\n\n // At this point we have an object that is not of an exported type. Either an object\n // literal, or an instance of a fully private class (cannot distinguish those cases).\n\n // We will serialize by-value, but recurse for serialization so that if\n // the object contains reference objects, they will be serialized appropriately.\n // (Basically, serialize anything else as a map of 'any').\n return mapValues(value, (v) =>\n host.recurse(v, { type: spec.CANONICAL_ANY }),\n );\n },\n\n deserialize(value, _type, host) {\n if (value == null) {\n return undefined;\n }\n\n if (isWireDate(value)) {\n host.debug('ANY is a Date');\n return deserializeDate(value);\n }\n if (isScalar(value)) {\n host.debug('ANY is a Scalar');\n return value;\n }\n if (Array.isArray(value)) {\n host.debug('ANY is an Array');\n return value.map((e) => host.recurse(e, { type: spec.CANONICAL_ANY }));\n }\n\n if (isWireEnum(value)) {\n host.debug('ANY is an Enum');\n return deserializeEnum(value, host.findSymbol);\n }\n if (isWireMap(value)) {\n host.debug('ANY is a Map');\n const mapOfAny: spec.CollectionTypeReference = {\n collection: {\n kind: spec.CollectionKind.Map,\n elementtype: spec.CANONICAL_ANY,\n },\n };\n return SERIALIZERS[SerializationClass.Map].deserialize(\n value,\n { type: mapOfAny },\n host,\n );\n }\n if (isObjRef(value)) {\n host.debug('ANY is a Ref');\n return host.objects.findObject(value).instance;\n }\n\n // if the value has a struct token, it was serialized by a typed jsii\n // struct, but since the deserialization target is ANY, all we can do is\n // strip the data from $jsii.struct and continue to deserialize as ANY.\n if (isWireStruct(value)) {\n const { fqn, data } = value[TOKEN_STRUCT];\n host.debug(`ANY is a struct of type ${fqn}`);\n return SERIALIZERS[SerializationClass.Struct].deserialize(\n data,\n { type: { fqn } },\n host,\n );\n }\n\n // At this point again, deserialize by-value.\n host.debug('ANY is a Map');\n return mapValues(value, (v) =>\n host.recurse(v, { type: spec.CANONICAL_ANY }),\n );\n },\n },\n};\n\nfunction serializeDate(value: Date): WireDate {\n return { [TOKEN_DATE]: value.toISOString() };\n}\n\nfunction deserializeDate(value: WireDate): Date {\n return new Date(value[TOKEN_DATE]);\n}\n\nfunction deserializeEnum(value: WireEnum, lookup: SymbolLookup) {\n const enumLocator = value[TOKEN_ENUM];\n const sep = enumLocator.lastIndexOf('/');\n if (sep === -1) {\n throw new Error(`Malformed enum value: ${JSON.stringify(value)}`);\n }\n\n const typeName = enumLocator.substr(0, sep);\n const valueName = enumLocator.substr(sep + 1);\n\n const enumValue = lookup(typeName)[valueName];\n if (enumValue === undefined) {\n throw new Error(`No enum member named ${valueName} in ${typeName}`);\n }\n return enumValue;\n}\n\nexport interface TypeSerialization {\n serializationClass: SerializationClass;\n typeRef: OptionalValueOrVoid;\n}\n\n/**\n * From a type reference, return the possible serialization types\n *\n * There can be multiple, because the type can be a type union.\n */\nexport function serializationType(\n typeRef: OptionalValueOrVoid,\n lookup: TypeLookup,\n): TypeSerialization[] {\n if (typeRef == null) {\n throw new Error(\"Kernel error: expected type information, got 'undefined'\");\n }\n if (typeRef === 'void') {\n return [{ serializationClass: SerializationClass.Void, typeRef }];\n }\n if (spec.isPrimitiveTypeReference(typeRef.type)) {\n switch (typeRef.type.primitive) {\n case spec.PrimitiveType.Any:\n return [{ serializationClass: SerializationClass.Any, typeRef }];\n case spec.PrimitiveType.Date:\n return [{ serializationClass: SerializationClass.Date, typeRef }];\n case spec.PrimitiveType.Json:\n return [{ serializationClass: SerializationClass.Json, typeRef }];\n case spec.PrimitiveType.Boolean:\n case spec.PrimitiveType.Number:\n case spec.PrimitiveType.String:\n return [{ serializationClass: SerializationClass.Scalar, typeRef }];\n }\n\n throw new Error('Unknown primitive type');\n }\n if (spec.isCollectionTypeReference(typeRef.type)) {\n return [\n {\n serializationClass:\n typeRef.type.collection.kind === spec.CollectionKind.Array\n ? SerializationClass.Array\n : SerializationClass.Map,\n typeRef,\n },\n ];\n }\n if (spec.isUnionTypeReference(typeRef.type)) {\n const compoundTypes = flatMap(typeRef.type.union.types, (t) =>\n serializationType({ type: t }, lookup),\n );\n // Propagate the top-level 'optional' field to each individual subtype\n for (const t of compoundTypes) {\n if (t.typeRef !== 'void') {\n t.typeRef.optional = typeRef.optional;\n }\n }\n return compoundTypes.sort((l, r) =>\n compareSerializationClasses(l.serializationClass, r.serializationClass),\n );\n }\n\n // The next part of the conversion is lookup-dependent\n const type = lookup(typeRef.type.fqn);\n\n if (spec.isEnumType(type)) {\n return [{ serializationClass: SerializationClass.Enum, typeRef }];\n }\n\n if (spec.isInterfaceType(type) && type.datatype) {\n return [{ serializationClass: SerializationClass.Struct, typeRef }];\n }\n\n return [{ serializationClass: SerializationClass.ReferenceType, typeRef }];\n}\n\nfunction nullAndOk(x: unknown, type: OptionalValueOrVoid): boolean {\n if (x != null) {\n return false;\n }\n\n if (type !== 'void' && !type.optional) {\n throw new Error(\n `Got 'undefined' for non-optional instance of ${JSON.stringify(type)}`,\n );\n }\n\n return true;\n}\n\nfunction isDate(x: unknown): x is Date {\n return (\n typeof x === 'object' &&\n Object.prototype.toString.call(x) === '[object Date]'\n );\n}\n\nfunction isScalar(x: unknown): x is string | number | boolean {\n return (\n typeof x === 'string' || typeof x === 'number' || typeof x === 'boolean'\n );\n}\n\nfunction flatMap(xs: T[], fn: (x: T) => U[]): U[] {\n const ret = new Array();\n for (const x of xs) {\n ret.push(...fn(x));\n }\n return ret;\n}\n\n/**\n * Map an object's values, skipping 'undefined' values'\n */\nfunction mapValues(\n value: unknown,\n fn: (value: any, field: string) => any,\n): { [key: string]: any } {\n if (typeof value !== 'object' || value == null) {\n throw new Error(`Expected object type, got ${JSON.stringify(value)}`);\n }\n\n const out: { [key: string]: any } = {};\n for (const [k, v] of Object.entries(value)) {\n const wireValue = fn(v, k);\n if (wireValue === undefined) {\n continue;\n }\n out[k] = wireValue;\n }\n return out;\n}\n\nfunction propertiesOf(\n t: spec.Type,\n lookup: TypeLookup,\n): { [name: string]: spec.Property } {\n if (!spec.isClassOrInterfaceType(t)) {\n return {};\n }\n\n let ret: { [name: string]: spec.Property } = {};\n\n if (t.interfaces) {\n for (const iface of t.interfaces) {\n ret = { ...ret, ...propertiesOf(lookup(iface), lookup) };\n }\n }\n if (spec.isClassType(t) && t.base) {\n ret = { ...ret, ...propertiesOf(lookup(t.base), lookup) };\n }\n\n for (const prop of t.properties ?? []) {\n ret[prop.name] = prop;\n }\n\n return ret;\n}\n\n/**\n * Tests whether a given type (by it's FQN) can be assigned to a named type reference.\n *\n * @param actualTypeFqn the FQN of the type that is being tested.\n * @param requiredType the required reference type.\n *\n * @returns true if ``requiredType`` is a super-type (base class or implemented interface) of the type designated by\n * ``actualTypeFqn``.\n */\nfunction isAssignable(\n actualTypeFqn: string,\n requiredType: spec.NamedTypeReference,\n lookup: TypeLookup,\n): boolean {\n // The empty object is assignable to everything\n if (actualTypeFqn === EMPTY_OBJECT_FQN) {\n return true;\n }\n\n if (requiredType.fqn === actualTypeFqn) {\n return true;\n }\n const actualType = lookup(actualTypeFqn);\n if (spec.isClassType(actualType)) {\n if (\n actualType.base &&\n isAssignable(actualType.base, requiredType, lookup)\n ) {\n return true;\n }\n }\n if (spec.isClassOrInterfaceType(actualType) && actualType.interfaces) {\n return (\n actualType.interfaces.find((iface) =>\n isAssignable(iface, requiredType, lookup),\n ) != null\n );\n }\n return false;\n}\n\nfunction validateRequiredProps(\n actualProps: { [key: string]: any },\n typeName: string,\n specProps: { [key: string]: spec.Property },\n) {\n // Check for required properties\n const missingRequiredProps = Object.keys(specProps)\n .filter((name) => !specProps[name].optional)\n .filter((name) => !(name in actualProps));\n\n if (missingRequiredProps.length > 0) {\n throw new Error(\n `Missing required properties for ${typeName}: ${missingRequiredProps.join(\n ', ',\n )}`,\n );\n }\n\n return actualProps;\n}\n\nfunction compareSerializationClasses(\n l: SerializationClass,\n r: SerializationClass,\n): number {\n const order = [\n SerializationClass.Void,\n SerializationClass.Date,\n SerializationClass.Scalar,\n SerializationClass.Json,\n SerializationClass.Enum,\n SerializationClass.Array,\n SerializationClass.Map,\n SerializationClass.Struct,\n SerializationClass.ReferenceType,\n SerializationClass.Any,\n ];\n return order.indexOf(l) - order.indexOf(r);\n}\n\n/**\n * Determines whether `obj` must be passed by-reference or if by-value is acceptable. For example,\n * objects with methods, or dynamic getters (or setters) should be passed by-reference as a matter\n * of security. The behavior in non-JS runtimes could otherwise differ from that in pure JS (if\n * getters are not stable, etc...).\n *\n * @param obj the object to be tested.\n *\n * @returns true if `obj` must be passed by-reference.\n */\nfunction isByReferenceOnly(obj: any): boolean {\n if (Array.isArray(obj)) {\n return false;\n }\n\n let curr = obj;\n // Crawl up the prototype chain to look for dynamic properties or methods.\n do {\n for (const prop of Object.getOwnPropertyNames(curr)) {\n const descr = Object.getOwnPropertyDescriptor(curr, prop);\n if (\n descr?.get != null ||\n descr?.set != null ||\n typeof descr?.value === 'function'\n ) {\n // Property has a dynamic getter, setter or is a constructor/method, so by-ref required!\n return true;\n }\n }\n // End when the parent proto is `Object`, which has no parent proto itself.\n } while (Object.getPrototypeOf((curr = Object.getPrototypeOf(curr))) != null);\n\n return false;\n}\n","import { api, Kernel } from '@jsii/kernel';\nimport { EventEmitter } from 'events';\n\nimport { Input, IInputOutput } from './in-out';\n\nexport class KernelHost {\n private readonly kernel = new Kernel(this.callbackHandler.bind(this));\n private readonly eventEmitter = new EventEmitter();\n\n public constructor(\n private readonly inout: IInputOutput,\n private readonly opts: { debug?: boolean; noStack?: boolean } = {},\n ) {\n this.kernel.traceEnabled = opts.debug ? true : false;\n }\n\n public run() {\n const req = this.inout.read();\n if (!req || 'exit' in req) {\n this.eventEmitter.emit('exit', req?.exit ?? 0);\n return; // done\n }\n\n this.processRequest(req, () => {\n // Schedule the call to run on the next event loop iteration to\n // avoid recursion.\n setImmediate(() => this.run());\n });\n }\n\n public once(event: 'exit', listener: (code: number) => void) {\n this.eventEmitter.once(event, listener);\n }\n\n private callbackHandler(callback: api.Callback) {\n // write a \"callback\" response, which is a special response that tells\n // the client that there's synchonous callback it needs to invoke and\n // bring back the result via a \"complete\" request.\n this.inout.write({ callback });\n\n return completeCallback.call(this);\n\n function completeCallback(this: KernelHost): void {\n const req = this.inout.read();\n if (!req || 'exit' in req) {\n throw new Error('Interrupted before callback returned');\n }\n\n // if this is a completion for the current callback, then we can\n // finally stop this nonsense and return the result.\n const completeReq = req as { complete: api.CompleteRequest };\n if (\n 'complete' in completeReq &&\n completeReq.complete.cbid === callback.cbid\n ) {\n if (completeReq.complete.err) {\n throw new Error(completeReq.complete.err);\n }\n\n return completeReq.complete.result;\n }\n\n // otherwise, process the request normally, but continue to wait for\n // our callback to be completed. sync=true to enforce that `completeCallback`\n // will be called synchronously and return value will be chained back so we can\n // return it to the callback handler.\n return this.processRequest(\n req,\n completeCallback.bind(this),\n /* sync */ true,\n );\n }\n }\n\n /**\n * Processes the input request `req` and writes the output response to\n * stdout. This method invokes `next` when the request was fully processed.\n * This either happens synchronously or asynchronously depending on the api\n * (e.g. the \"end\" api will wait for an async promise to be fulfilled before\n * it writes the response)\n *\n * @param req The input request\n * @param next A callback to invoke to continue\n * @param sync If this is 'true', \"next\" must be called synchronously. This means\n * that we won't process any async activity (begin/complete). The kernel\n * doesn't allow any async operations during a sync callback, so this shouldn't\n * happen, so we assert in this case to find bugs.\n */\n private processRequest(req: Input, next: () => void, sync = false) {\n if ('callback' in req) {\n throw new Error(\n 'Unexpected `callback` result. This request should have been processed by a callback handler',\n );\n }\n\n if (!('api' in req)) {\n throw new Error('Malformed request, \"api\" field is required');\n }\n\n const apiReq = req;\n const fn = this.findApi(apiReq.api);\n\n try {\n const ret = fn.call(this.kernel, req);\n\n // special case for 'begin' and 'complete' which are on an async\n // promise path. in order to allow the kernel to actually fulfill\n // the promise, and continue any async flows (which may potentially\n // start other promises), we respond only within a setImmediate\n // block, which is scheduled in the same micro-tasks queue as\n // promises. see the kernel test 'async overrides: two overrides'\n // for an example for this use case.\n if (apiReq.api === 'begin' || apiReq.api === 'complete') {\n checkIfAsyncIsAllowed();\n\n this.debug('processing pending promises before responding');\n\n setImmediate(() => {\n this.writeOkay(ret);\n next();\n });\n\n return undefined;\n }\n\n // if this is an async method, return immediately and\n // call next only when the promise is fulfilled.\n if (this.isPromise(ret)) {\n checkIfAsyncIsAllowed();\n\n this.debug('waiting for promise to be fulfilled');\n\n const promise = ret;\n promise\n .then((val) => {\n this.debug('promise succeeded:', val);\n this.writeOkay(val);\n next();\n })\n .catch((e) => {\n this.debug('promise failed:', e);\n this.writeError(e);\n next();\n });\n\n return undefined;\n }\n\n this.writeOkay(ret);\n } catch (e) {\n this.writeError(e);\n }\n\n // indicate this request was processed (synchronously).\n return next();\n\n function checkIfAsyncIsAllowed() {\n if (sync) {\n throw new Error(\n 'Cannot handle async operations while waiting for a sync callback to return',\n );\n }\n }\n }\n\n /**\n * Writes an \"ok\" result to stdout.\n */\n private writeOkay(result: any) {\n const res = { ok: result };\n this.inout.write(res);\n }\n\n /**\n * Writes an \"error\" result to stdout.\n */\n private writeError(error: any) {\n const res = { error: error.message, stack: undefined };\n if (!this.opts.noStack) {\n res.stack = error.stack;\n }\n this.inout.write(res);\n }\n\n /**\n * Returns true if the value is a promise.\n */\n private isPromise(v: any): v is Promise {\n return typeof v?.then === 'function';\n }\n\n /**\n * Given a kernel api name, returns the function to invoke.\n */\n private findApi(apiName: string): (this: Kernel, arg: Input) => any {\n const fn = (this.kernel as any)[apiName];\n if (typeof fn !== 'function') {\n throw new Error(`Invalid kernel api call: ${apiName}`);\n }\n return fn;\n }\n\n private debug(...args: any[]) {\n if (!this.opts.debug) {\n return;\n }\n\n console.error(...args);\n }\n}\n","import { api } from '@jsii/kernel';\n\nimport { SyncStdio } from './sync-stdio';\n\nexport type Output =\n | { hello: string }\n | { ok: api.KernelResponse }\n | { callback: api.Callback }\n | { pending: true }\n | { error: string; stack?: string };\n\nexport type Input =\n | ({ api: string } & api.KernelRequest)\n | { complete: api.CompleteRequest };\n\nexport type Exit = { exit: number };\n\n/**\n * An IO provider for jsii API exchanges.\n */\nexport interface IInputOutput {\n /**\n * Writes a message to the jsii API host.\n * @param message the message to be sent.\n */\n write(message: Output): void;\n\n /**\n * Wait for a message from the jsii API host, then return it.\n *\n * @returns the received message, or `undefined` if the API host has no more\n * requests to send.\n */\n read(): Input | Exit | undefined;\n}\n\nexport class InputOutput implements IInputOutput {\n public debug = false;\n\n public constructor(private readonly stdio: SyncStdio) {}\n\n public write(obj: Output) {\n const output = JSON.stringify(obj);\n this.stdio.writeLine(output);\n\n if (this.debug) {\n this.stdio.writeErrorLine(`< ${output}`);\n }\n }\n\n public read(): Input | undefined {\n let reqLine = this.stdio.readLine();\n if (!reqLine) {\n return undefined;\n }\n\n // skip recorded responses\n if (reqLine.startsWith('< ')) {\n return this.read();\n }\n\n // stip \"> \" from recorded requests\n if (reqLine.startsWith('> ')) {\n reqLine = reqLine.substr(2);\n }\n\n const input = JSON.parse(reqLine);\n\n if (this.debug) {\n this.stdio.writeErrorLine(`> ${JSON.stringify(input)}`);\n }\n\n return input;\n }\n}\n","import * as fs from 'fs';\n\nconst INPUT_BUFFER_SIZE = 1_048_576; // 1MiB (aka: 1024 * 1024), not related to max line length\n\nexport class SyncStdio {\n private bufferedData = Buffer.alloc(0);\n\n private readonly stderr: number;\n private readonly stdin: number;\n private readonly stdout: number;\n\n // A buffer that will be used for all reading operations.\n private readonly readBuffer = Buffer.alloc(INPUT_BUFFER_SIZE);\n\n public constructor({ errorFD, readFD, writeFD }: SyncStdioOptions) {\n this.stderr = errorFD;\n this.stdin = readFD;\n this.stdout = writeFD;\n }\n\n public writeErrorLine(line: string) {\n this.writeBuffer(Buffer.from(`${line}\\n`), this.stderr);\n }\n\n public writeLine(line: string) {\n this.writeBuffer(Buffer.from(`${line}\\n`), this.stdout);\n }\n\n public readLine(): string | undefined {\n while (!this.bufferedData.includes('\\n', 0, 'utf-8')) {\n const read = fs.readSync(\n this.stdin,\n this.readBuffer,\n 0,\n this.readBuffer.length,\n null,\n );\n\n if (read === 0) {\n return undefined;\n }\n\n const newData = this.readBuffer.slice(0, read);\n this.bufferedData = Buffer.concat([this.bufferedData, newData]);\n }\n\n const newLinePos = this.bufferedData.indexOf('\\n', 0, 'utf-8');\n const next = this.bufferedData.slice(0, newLinePos).toString('utf-8');\n this.bufferedData = this.bufferedData.slice(newLinePos + 1);\n\n return next;\n }\n\n private writeBuffer(buffer: Buffer, fd: number) {\n let offset = 0;\n while (offset < buffer.length) {\n try {\n offset += fs.writeSync(fd, buffer, offset);\n } catch (e) {\n // We might get EAGAIN if the file descriptor was not opened for\n // blocking (O_SYNC) writes. In such cases, we'll keep trying until it\n // succeeds. This shouldn't take long as the process on the other side\n // is expected to actively wait for data on those pipes.\n if (e.code !== 'EAGAIN') {\n throw e;\n }\n }\n }\n }\n}\n\nexport interface SyncStdioOptions {\n /**\n * The file descriptor from which data is to be read. This MUST be opened for\n * blocking (O_SYNC) reading.\n */\n readonly readFD: number;\n\n /**\n * The file descriptor to which data is to be written. This SHOULD be opened\n * for blocking (O_SYNC) writing.\n */\n readonly writeFD: number;\n\n /**\n * The file descriptor to which errors data is to be written. This SHOULD be\n * opened for blocking (O_SYNC) writing.\n */\n readonly errorFD: number;\n}\n","export const SPEC_FILE_NAME = '.jsii';\n\n/**\n * A JSII assembly specification.\n */\nexport interface Assembly extends AssemblyConfiguration, Documentable {\n /**\n * The version of the spec schema\n */\n schema: SchemaVersion.LATEST;\n\n /**\n * The name of the assembly\n *\n * @minLength 1\n */\n name: string;\n\n /**\n * Description of the assembly, maps to \"description\" from package.json\n * This is required since some package managers (like Maven) require it.\n */\n description: string;\n\n /**\n * The url to the project homepage. Maps to \"homepage\" from package.json.\n */\n homepage: string;\n\n /**\n * The module repository, maps to \"repository\" from package.json\n * This is required since some package managers (like Maven) require it.\n */\n repository: {\n /**\n * The type of the repository (``git``, ``svn``, ...)\n */\n type: string;\n\n /**\n * The URL of the repository.\n */\n url: string;\n\n /**\n * If the package is not in the root directory (for example, when part\n * of a monorepo), you should specify the directory in which it lives.\n *\n * @default the root of the repository\n */\n directory?: string;\n };\n\n /**\n * The main author of this package.\n */\n author: Person;\n\n /**\n * Additional contributors to this package.\n *\n * @default none\n */\n contributors?: Person[];\n\n /**\n * A fingerprint that can be used to determine if the specification has\n * changed.\n *\n * @minLength 1\n */\n fingerprint: string;\n\n /**\n * The version of the assembly\n * @minLength 1\n */\n version: string;\n\n /**\n * The version of the jsii compiler that was used to produce this Assembly.\n * @minLength 1\n */\n jsiiVersion: string;\n\n /**\n * The SPDX name of the license this assembly is distributed on.\n */\n license: string;\n\n /**\n * Arbitrary key-value pairs of metadata, which the maintainer chose to\n * document with the assembly. These entries do not carry normative\n * semantics and their interpretation is up to the assembly maintainer.\n *\n * @default none\n */\n metadata?: { [key: string]: any };\n\n /**\n * Keywords that help discover or identify this packages with respects to it's\n * intended usage, audience, etc... Where possible, this will be rendered in\n * the corresponding metadata section of idiomatic package manifests, for\n * example NuGet package tags.\n */\n keywords?: string[];\n\n /**\n * Direct dependencies on other assemblies (with semver), the key is the JSII\n * assembly name, and the value is a SemVer expression.\n *\n * @default none\n */\n dependencies?: { [assembly: string]: string };\n\n /**\n * Target configuration for all the assemblies that are direct or transitive\n * dependencies of this assembly. This is needed to generate correct native\n * type names for any transitively inherited member, in certain languages.\n *\n * @default none\n */\n dependencyClosure?: { [assembly: string]: AssemblyConfiguration };\n\n /**\n * List if bundled dependencies (these are not expected to be jsii\n * assemblies).\n *\n * @default none\n */\n bundled?: { [module: string]: string };\n\n /**\n * All types in the assembly, keyed by their fully-qualified-name\n *\n * @default none\n */\n types?: { [fqn: string]: Type };\n\n /**\n * List of bin-scripts\n *\n * @default none\n */\n bin?: { readonly [script: string]: string };\n}\n\n/**\n * Shareable configuration of a jsii Assembly.\n */\nexport interface AssemblyConfiguration extends Targetable {\n /**\n * Submodules declared in this assembly.\n *\n * @default none\n */\n submodules?: { [fqn: string]: Submodule };\n}\n\n/**\n * A targetable module-like thing\n *\n * Has targets and a readme. Used for Assemblies and Submodules.\n */\nexport interface Targetable {\n /**\n * A map of target name to configuration, which is used when generating\n * packages for various languages.\n *\n * @default none\n */\n targets?: AssemblyTargets;\n\n /**\n * The readme document for this module (if any).\n *\n * @default none\n */\n readme?: ReadMe;\n}\n\n/**\n * README information\n */\nexport interface ReadMe {\n markdown: string;\n}\n\n/**\n * A submodule\n *\n * The difference between a top-level module (the assembly) and a submodule is\n * that the submodule is annotated with its location in the repository.\n */\nexport type Submodule = SourceLocatable & Targetable;\n\n/**\n * Versions of the JSII Assembly Specification.\n */\nexport enum SchemaVersion {\n LATEST = 'jsii/0.10.0',\n}\n\n/**\n * Fully Qualified Name\n */\nexport type FQN = string;\n\n/**\n * Metadata about people or organizations associated with the project that\n * resulted in the Assembly. Some of this metadata is required in order to\n * publish to certain package repositories (for example, Maven Central), but is\n * not normalized, and the meaning of fields (role, for example), is up to each\n * project maintainer.\n */\nexport interface Person {\n /**\n * The name of the person\n */\n name: string;\n\n /**\n * A list of roles this person has in the project, for example `maintainer`,\n * `contributor`, `owner`, ...\n */\n roles: string[];\n\n /**\n * The email of the person\n *\n * @default none\n */\n email?: string;\n\n /**\n * The URL for the person\n *\n * @default none\n */\n url?: string;\n\n /**\n * If true, this person is, in fact, an organization\n *\n * @default false\n */\n organization?: boolean;\n}\n\n/**\n * Configurable targets for an asembly.\n */\nexport interface AssemblyTargets {\n /**\n * Information about a particular language's targets\n */\n [language: string]: { [key: string]: any } | undefined;\n}\n\n/**\n * Where in the module source the definition for this API item was found\n */\nexport interface SourceLocation {\n /**\n * Relative filename\n */\n filename: string;\n\n /**\n * 1-based line number in the indicated file\n */\n line: number;\n}\n\n/**\n * Key value pairs of documentation nodes.\n * Based on TSDoc.\n */\nexport interface Docs {\n /**\n * Summary documentation for an API item.\n *\n * The first part of the documentation before hitting a `@remarks` tags, or\n * the first line of the doc comment block if there is no `@remarks` tag.\n *\n * @default none\n */\n summary?: string;\n\n /**\n * Detailed information about an API item.\n *\n * Either the explicitly tagged `@remarks` section, otherwise everything\n * past the first paragraph if there is no `@remarks` tag.\n *\n * @default none\n */\n remarks?: string;\n\n /**\n * If present, this block indicates that an API item is no longer supported\n * and may be removed in a future release. The `@deprecated` tag must be\n * followed by a sentence describing the recommended alternative.\n * Deprecation recursively applies to members of a container. For example,\n * if a class is deprecated, then so are all of its members.\n *\n * @default none\n */\n deprecated?: string;\n\n /**\n * The `@returns` block for this doc comment, or undefined if there is not\n * one.\n *\n * @default none\n */\n returns?: string;\n\n /**\n * Whether the API item is beta/experimental quality\n */\n stability?: Stability;\n\n /**\n * Example showing the usage of this API item\n *\n * Starts off in running text mode, may switch to code using fenced code\n * blocks.\n *\n * @default none\n */\n example?: string;\n\n /**\n * A `@see` link with more information\n *\n * @default none\n */\n see?: string;\n\n /**\n * Whether this class or interface was intended to be subclassed/implemented\n * by library users.\n *\n * Classes intended for subclassing, and interfaces intended to be\n * implemented by consumers, are held to stricter standards of API\n * compatibility.\n *\n * @default false\n */\n subclassable?: boolean;\n\n /**\n * Description of the default\n *\n * @default none\n */\n default?: string;\n\n /**\n * Custom tags that are not any of the default ones\n *\n * @default none\n */\n custom?: { [tag: string]: string };\n}\n\n/**\n * API Stability levels. These are modeled after the `node` stability index.\n *\n * @see https://nodejs.org/api/documentation.html#documentation_stability_index.\n */\nexport enum Stability {\n /**\n * The API may emit warnings. Backward compatibility is not guaranteed.\n *\n * More information about the deprecation can usually be found in the\n * `deprecated` field.\n */\n Deprecated = 'deprecated',\n\n /**\n * This API is still under active development and subject to non-backward\n * compatible changes or removal in any future version. Use of the API is\n * not recommended in production environments. Experimental APIs are not\n * subject to the Semantic Versioning model.\n */\n Experimental = 'experimental',\n\n /**\n * This API is subject to the Semantic Versioning model and may not change\n * in breaking ways in a subsequent minor or patch version.\n */\n Stable = 'stable',\n\n /**\n * This API is an representation of an API managed elsewhere and follows\n * the other API's versioning model.\n */\n External = 'external',\n}\n\n/**\n * Indicates that an entity is documentable.\n */\nexport interface Documentable {\n /**\n * Documentation for this entity.\n *\n * @default none\n */\n docs?: Docs;\n}\n\n/**\n * Indicates that an entity has a source location\n */\nexport interface SourceLocatable {\n /**\n * Where in the module this definition was found\n *\n * Why is this not `locationInAssembly`? Because the assembly is the JSII\n * file combining compiled code and its manifest, whereas this is referring\n * to the location of the source in the module the assembly was built from.\n *\n * @default none\n */\n locationInModule?: SourceLocation;\n}\n\n/**\n * Kinds of collections.\n */\nexport enum CollectionKind {\n /**\n * An array, or a list of some element type.\n */\n Array = 'array',\n /**\n * A map of a string to some element type.\n */\n Map = 'map',\n}\n\n/**\n * Kinds of primitive types.\n */\nexport enum PrimitiveType {\n /**\n * A JSON date (represented as it's ISO-8601 string form).\n */\n Date = 'date',\n\n /**\n * A plain string.\n */\n String = 'string',\n\n /**\n * A number (integer or float).\n */\n Number = 'number',\n\n /**\n * A boolean value.\n */\n Boolean = 'boolean',\n\n /**\n * A JSON object\n */\n Json = 'json',\n\n /**\n * Value with \"any\" or \"unknown\" type (aka Object). Values typed `any` may\n * be `null` or `undefined`.\n */\n Any = 'any',\n}\n\n/**\n * A value that can possibly be optional.\n */\nexport interface OptionalValue {\n /**\n * Determines whether the value is, indeed, optional.\n *\n * @default false\n */\n optional?: boolean;\n\n /**\n * The declared type of the value, when it's present.\n */\n type: TypeReference;\n}\n\n/**\n * A reference to a type (primitive, collection or fqn).\n */\nexport type TypeReference =\n | NamedTypeReference\n | PrimitiveTypeReference\n | CollectionTypeReference\n | UnionTypeReference;\n\n/**\n * The standard representation of the `any` type (includes optionality marker).\n */\nexport const CANONICAL_ANY: Readonly = {\n primitive: PrimitiveType.Any,\n};\n\n/**\n * Reference to a named type, defined by this assembly or one of its\n * dependencies.\n */\nexport interface NamedTypeReference {\n /**\n * The fully-qualified-name of the type (can be located in the\n * ``spec.types[fqn]``` of the assembly that defines the type).\n */\n fqn: FQN;\n}\nexport function isNamedTypeReference(\n ref: TypeReference | undefined,\n): ref is NamedTypeReference {\n return !!(ref as NamedTypeReference)?.fqn;\n}\n\n/**\n * Reference to a primitive type.\n */\nexport interface PrimitiveTypeReference {\n /**\n * If this is a reference to a primitive type, this will include the\n * primitive type kind.\n */\n primitive: PrimitiveType;\n}\nexport function isPrimitiveTypeReference(\n ref: TypeReference | undefined,\n): ref is PrimitiveTypeReference {\n return !!(ref as PrimitiveTypeReference)?.primitive;\n}\n\n/**\n * Reference to a collection type.\n */\nexport interface CollectionTypeReference {\n collection: {\n /**\n * The kind of collection.\n */\n kind: CollectionKind;\n\n /**\n * The type of an element (map keys are always strings).\n */\n elementtype: TypeReference;\n };\n}\nexport function isCollectionTypeReference(\n ref: TypeReference | undefined,\n): ref is CollectionTypeReference {\n return !!(ref as CollectionTypeReference)?.collection;\n}\n\n/**\n * Reference to a union type.\n */\nexport interface UnionTypeReference {\n /**\n * Indicates that this is a union type, which means it can be one of a set\n * of types.\n */\n union: {\n /**\n * All the possible types (including the primary type).\n *\n * @minItems 2\n */\n types: TypeReference[];\n };\n}\nexport function isUnionTypeReference(\n ref: TypeReference | undefined,\n): ref is UnionTypeReference {\n return !!(ref as UnionTypeReference)?.union;\n}\n\n/**\n * Methods and properties can be overridden from parent classes or implemented\n * from interfaces.\n */\nexport interface Overridable {\n /**\n * The FQN of the parent type (class or interface) that this entity\n * overrides or implements. If undefined, then this entity is the first in\n * it's hierarchy to declare this entity.\n *\n * @default this member is not overriding anything\n */\n overrides?: FQN;\n}\n\n/**\n * A class property.\n */\nexport interface Property\n extends Documentable,\n OptionalValue,\n Overridable,\n SourceLocatable {\n /**\n * The name of the property.\n *\n * @minLength 1\n */\n name: string;\n\n /**\n * Indicates if this property only has a getter (immutable).\n *\n * @default false\n */\n immutable?: boolean;\n\n /**\n * Indicates if this property is protected (otherwise it is public)\n *\n * @default false\n */\n protected?: boolean;\n\n /**\n * Indicates if this property is abstract\n *\n * @default false\n */\n abstract?: boolean;\n\n /**\n * Indicates if this is a static property.\n *\n * @default false\n */\n static?: boolean;\n\n /**\n * A hint that indicates that this static, immutable property is initialized\n * during startup. This allows emitting \"const\" idioms in different target\n * languages. Implies `static` and `immutable`.\n *\n * @default false\n */\n const?: boolean;\n}\n\n/**\n * Represents a method parameter.\n */\nexport interface Parameter extends Documentable, OptionalValue {\n /**\n * The name of the parameter.\n *\n * @minLength 1\n */\n name: string;\n\n /**\n * Whether this is the last parameter of a variadic method. In such cases,\n * the `#type` attribute is the type of each individual item of the variadic\n * arguments list (as opposed to some array type, as for example TypeScript\n * would model it).\n *\n * @default false\n */\n variadic?: boolean;\n}\n\n/**\n * An Initializer or a Method.\n */\nexport interface Callable extends Documentable, Overridable, SourceLocatable {\n /**\n * The parameters of the Initializer or Method.\n *\n * @default none\n */\n parameters?: Parameter[];\n\n /**\n * Indicates if this Initializer or Method is protected (otherwise it is\n * public, since private members are not modeled).\n *\n * @default false\n */\n protected?: boolean;\n\n /**\n * Indicates whether this Initializer or Method is variadic or not. When\n * ``true``, the last element of ``#parameters`` will also be flagged\n * ``#variadic``.\n *\n * @default false\n */\n variadic?: boolean;\n}\n\n/**\n * An initializer.\n */\nexport type Initializer = Callable;\n\n/**\n * A method with a name (i.e: not an initializer).\n */\nexport interface Method extends Callable {\n /**\n * The name of the method. Undefined if this method is a initializer.\n */\n name: string;\n\n /**\n * The return type of the method (`undefined` if `void`)\n *\n * @default void\n */\n returns?: OptionalValue;\n\n /**\n * Is this method an abstract method (this means the class will also be an abstract class)\n *\n * @default false\n */\n abstract?: boolean;\n\n /**\n * Indicates if this is an asynchronous method (it will return a promise).\n *\n * @default false\n */\n async?: boolean;\n\n /**\n * Indicates if this is a static method.\n *\n * @default false\n */\n static?: boolean;\n}\n/**\n * Determines whether a Callable is a Method or not.\n *\n * @param callable the callable to be checked.\n */\nexport function isMethod(callable: Callable): callable is Method {\n return !!(callable as Method).name;\n}\n\n/**\n * Represents a type definition (not a type reference).\n */\nexport type Type = TypeBase & (ClassType | EnumType | InterfaceType);\n\n/**\n * Common attributes of a type definition.\n */\nexport interface TypeBase extends Documentable, SourceLocatable {\n /**\n * The fully qualified name of the type (``..``)\n *\n * @minLength 3\n */\n fqn: FQN;\n\n /**\n * The name of the assembly the type belongs to.\n *\n * @minLength 1\n */\n assembly: string;\n\n /**\n * The namespace of the type (``foo.bar.baz``). When undefined, the type is located at the root of the assembly\n * (it's ``fqn`` would be like ``.``). If the `namespace` corresponds to an existing type's\n * namespace-qualified (e.g: ``.``), then the current type is a nested type.\n *\n * @default none\n */\n namespace?: string;\n\n /**\n * The simple name of the type (MyClass).\n *\n * @minLength 1\n */\n name: string;\n\n /**\n * The kind of the type.\n */\n kind: TypeKind;\n}\n\n/**\n * Kinds of types.\n */\nexport enum TypeKind {\n Class = 'class',\n Enum = 'enum',\n Interface = 'interface',\n}\n\n/**\n * Represents classes.\n */\nexport interface ClassType extends TypeBase {\n kind: TypeKind.Class;\n\n /**\n * The FQN of the base class of this class, if it has one.\n *\n * @default no base class\n */\n base?: FQN;\n\n /**\n * Initializer (constructor) method.\n *\n * @default no initializer\n */\n initializer?: Initializer;\n\n /**\n * List of properties.\n *\n * @default none\n */\n properties?: Property[];\n\n /**\n * List of methods.\n *\n * @default none\n */\n methods?: Method[];\n\n /**\n * Indicates if this class is an abstract class.\n *\n * @default false\n */\n abstract?: boolean;\n\n /**\n * The FQNs of the interfaces this class implements, if any.\n *\n * @default none\n * @uniqueItems true\n */\n interfaces?: FQN[];\n}\n\nexport function isClassType(type: Type | undefined): type is ClassType {\n return type?.kind === TypeKind.Class;\n}\n\nexport interface InterfaceType extends TypeBase {\n kind: TypeKind.Interface;\n\n /**\n * The FQNs of the interfaces this interface extends, if any.\n *\n * @default none\n * @uniqueItems true\n */\n interfaces?: FQN[];\n\n /**\n * List of methods.\n *\n * @default none\n */\n methods?: Method[];\n\n /**\n * List of properties.\n *\n * @default none\n */\n properties?: Property[];\n\n /**\n * True if this interface only contains properties. Different backends might\n * have idiomatic ways to allow defining concrete instances such interfaces.\n * For example, in Java, the generator will produce a PoJo and a builder\n * which will allow users to create a concrete object with data which\n * adheres to this interface.\n *\n * @default false\n */\n datatype?: boolean;\n}\n\nexport function isInterfaceType(type: Type | undefined): type is InterfaceType {\n return type?.kind === TypeKind.Interface;\n}\n\n/**\n * Represents a member of an enum.\n */\nexport interface EnumMember extends Documentable {\n /**\n * The name/symbol of the member.\n */\n name: string;\n}\n\n/**\n * Represents an enum type.\n */\nexport interface EnumType extends TypeBase {\n kind: TypeKind.Enum;\n\n /**\n * Members of the enum.\n */\n members: EnumMember[];\n}\n\nexport function isEnumType(type: Type | undefined): type is EnumType {\n return type?.kind === TypeKind.Enum;\n}\n\n/**\n * Return whether this type is a class or interface type\n */\nexport function isClassOrInterfaceType(\n type: Type | undefined,\n): type is InterfaceType | ClassType {\n return isClassType(type) || isInterfaceType(type);\n}\n\n/**\n * Return a string representation of the given type reference.\n */\nexport function describeTypeReference(type?: TypeReference): string {\n if (type === undefined) {\n return 'void';\n }\n\n if (isNamedTypeReference(type)) {\n return type.fqn;\n }\n\n if (isPrimitiveTypeReference(type)) {\n return type.primitive;\n }\n\n if (isCollectionTypeReference(type)) {\n return `${type.collection.kind}<${describeTypeReference(\n type.collection.elementtype,\n )}>`;\n }\n\n if (isUnionTypeReference(type)) {\n const unionType = type.union.types.map(describeTypeReference).join(' | ');\n return unionType;\n }\n\n throw new Error('Unrecognized type reference');\n}\n\n/**\n * Determines whether an entity is deprecated.\n *\n * @param entity the entity to be checked.\n *\n * @returns true if the entity is marked as deprecated.\n */\nexport function isDeprecated(entity: Documentable): boolean {\n return entity?.docs?.stability === Stability.Deprecated;\n}\n","export * from './assembly';\nexport * from './configuration';\nexport * from './name-tree';\nexport * from './validate-assembly';\n","import * as spec from './assembly';\n\n/**\n * A tree of all names in a module. A node represent a type (terminal)\n * and may represent another node in the namespace (at the same time).\n * Therefore, a key of '_' represents a terminal and references the fqn\n * of the type.\n *\n * For example, say we have the following types:\n * - aws.ec2.Host\n * - aws.ec2.Instance\n * - aws.ec2.Instance.Subtype\n *\n * the the name tree will look like this:\n *\n * module: {\n * children: {\n * aws: {\n * children {\n * ec2: {\n * children: {\n * Host: {\n * fqn: 'aws.ec2.Host',\n * children: {}\n * },\n * Instance: {\n * fqn: 'aws.ec2.Host',\n * children: {\n * Subtype: {\n * fqn: 'aws.ec2.Host.Subtype',\n * children: {}\n * }\n * }\n * }\n * }\n * }\n * }\n * }\n * }\n * }\n */\nexport class NameTree {\n public static of(assm: spec.Assembly): NameTree {\n const nameTree = new NameTree();\n for (const type of Object.values(assm.types ?? {})) {\n nameTree.register(type.fqn);\n }\n return nameTree;\n }\n\n private _children: { [name: string]: NameTree } = {};\n private _fqn?: string;\n\n /* NameTree.of(assembly) should be used. */\n private constructor() {}\n\n /** The children of this node, by name. */\n public get children(): { readonly [name: string]: NameTree } {\n return this._children;\n }\n\n /** The fully qualified name of the type at this node, if there is one. */\n public get fqn(): string | undefined {\n return this._fqn;\n }\n\n /**\n * Adds a type to this ``NameTree``.\n *\n * @param type the type to be added.\n * @param path the path at which to add the node under this tree.\n */\n private register(fqn: string, path: string[] = fqn.split('.')): this {\n if (path.length === 0) {\n this._fqn = fqn;\n } else {\n const [head, ...rest] = path;\n if (!this._children[head]) {\n this._children[head] = new NameTree();\n }\n this._children[head]!.register(fqn, rest);\n }\n return this;\n }\n}\n","import { Schema, Validator } from 'jsonschema';\n\nimport { Assembly } from './assembly';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\nexport const schema: Schema = require('../schema/jsii-spec.schema.json');\n\nexport function validateAssembly(obj: any): Assembly {\n const validator = new Validator();\n validator.addSchema(schema); // For definitions\n const result = validator.validate(obj, schema, { nestedErrors: true } as any); // nestedErrors does exist but is not in the TypeScript definitions\n if (result.valid) {\n return obj;\n }\n throw new Error(`Invalid assembly:\\n${result.toString()}`);\n}\n","module.exports = require(\"assert\");;","module.exports = require(\"buffer\");;","module.exports = require(\"child_process\");;","module.exports = require(\"constants\");;","module.exports = require(\"crypto\");;","module.exports = require(\"events\");;","module.exports = require(\"fs\");;","module.exports = require(\"module\");;","module.exports = require(\"os\");;","module.exports = require(\"path\");;","module.exports = require(\"process\");;","module.exports = require(\"stream\");;","module.exports = require(\"string_decoder\");;","module.exports = require(\"url\");;","module.exports = require(\"util\");;","module.exports = require(\"vm\");;","module.exports = require(\"zlib\");;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","import * as process from 'process';\n\nimport * as packageInfo from '../package.json';\nimport { KernelHost } from './host';\nimport { InputOutput } from './in-out';\nimport { SyncStdio } from './sync-stdio';\n\nconst name = packageInfo.name;\nconst version = packageInfo.version;\n\nconst noStack = !!process.env.JSII_NOSTACK;\nconst debug = !!process.env.JSII_DEBUG;\n\n// This assumes FD#3 is opened for reading and writing. This is normally\n// performed by`bin/jsii-runtime.js`, and we will not be verifying this once\n// again...Meaning that failure to have set this up correctly results in\n// undefined behavior(likely a crash).\nconst stdio = new SyncStdio({\n // \"process.stderr.fd\" is not in @types/node definitions because it can be\n // absent in certain circumstances (for example, in `worker_threads` workers).\n // We'll fall-back to `2` - its expected value - in this case; but this is not\n // supposed to be happening here (we don't use `worker_threads`).\n errorFD: (process.stderr as any).fd ?? 2,\n readFD: 3,\n writeFD: 3,\n});\n\nconst inout = new InputOutput(stdio);\nconst host = new KernelHost(inout, { debug, noStack });\n\nhost.once('exit', process.exit.bind(process));\n\n// say hello\ninout.write({ hello: `${name}@${version}` });\ninout.debug = debug; // we don't want \"hello\" emitted\n\nhost.run();\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/at-least-node/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/chownr/chownr.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/copy-sync/copy-sync.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/copy-sync/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/copy/copy.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/copy/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/empty/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/file.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/link.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/symlink-paths.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/symlink-type.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/ensure/symlink.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/fs/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/json/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/json/jsonfile.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/json/output-json-sync.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/json/output-json.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/mkdirs/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/mkdirs/make-dir.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/move-sync/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/move-sync/move-sync.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/move/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/move/move.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/output/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/path-exists/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/remove/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/remove/rimraf.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/util/stat.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/lib/util/utimes.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-extra/node_modules/universalify/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/fs-minipass/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/graceful-fs/clone.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/graceful-fs/graceful-fs.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/graceful-fs/legacy-streams.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/graceful-fs/polyfills.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonfile/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonfile/node_modules/universalify/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonfile/utils.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/attribute.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/helpers.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/scan.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/jsonschema/lib/validator.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/minipass/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/minizlib/constants.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/minizlib/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/find-made.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/mkdirp-manual.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/mkdirp-native.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/opts-arg.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/path-arg.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/mkdirp/lib/use-native.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/index.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/create.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/extract.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/get-write-flag.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/header.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/high-level-opt.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/large-numbers.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/list.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/mkdir.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/mode-fix.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/pack.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/parse.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/path-reservations.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/pax.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/read-entry.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/replace.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/types.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/unpack.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/update.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/warn-mixin.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/winchars.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/tar/lib/write-entry.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/yallist/iterator.js","webpack://@jsii/runtime/../node_modules/source-map-loader/node_modules/yallist/yallist.js","webpack://@jsii/runtime/../kernel/lib/api.ts","webpack://@jsii/runtime/../kernel/lib/index.ts","webpack://@jsii/runtime/../kernel/lib/kernel.ts","webpack://@jsii/runtime/../kernel/lib/objects.ts","webpack://@jsii/runtime/../kernel/lib/on-exit.ts","webpack://@jsii/runtime/../kernel/lib/serialization.ts","webpack://@jsii/runtime/./lib/host.ts","webpack://@jsii/runtime/./lib/in-out.ts","webpack://@jsii/runtime/./lib/sync-stdio.ts","webpack://@jsii/runtime/../spec/lib/assembly.ts","webpack://@jsii/runtime/../spec/lib/index.ts","webpack://@jsii/runtime/../spec/lib/name-tree.ts","webpack://@jsii/runtime/../spec/lib/validate-assembly.ts","webpack://@jsii/runtime/external \"assert\"","webpack://@jsii/runtime/external \"buffer\"","webpack://@jsii/runtime/external \"child_process\"","webpack://@jsii/runtime/external \"constants\"","webpack://@jsii/runtime/external \"crypto\"","webpack://@jsii/runtime/external \"events\"","webpack://@jsii/runtime/external \"fs\"","webpack://@jsii/runtime/external \"module\"","webpack://@jsii/runtime/external \"os\"","webpack://@jsii/runtime/external \"path\"","webpack://@jsii/runtime/external \"process\"","webpack://@jsii/runtime/external \"stream\"","webpack://@jsii/runtime/external \"string_decoder\"","webpack://@jsii/runtime/external \"url\"","webpack://@jsii/runtime/external \"util\"","webpack://@jsii/runtime/external \"vm\"","webpack://@jsii/runtime/external \"zlib\"","webpack://@jsii/runtime/webpack/bootstrap","webpack://@jsii/runtime/webpack/runtime/node module decorator","webpack://@jsii/runtime/./lib/program.ts"],"names":["module","exports","r","n","process","versions","node","split","map","x","parseInt","fs","path","LCHOWN","lchown","LCHOWNSYNC","lchownSync","needEISDIRHandled","version","match","uid","gid","er","code","chownSync","handleEISDIR","cb","chown","_","__","___","handleEISDirSync","nodeVersion","readdir","options","readdirSync","test","cpath","chownrKid","p","child","lstat","resolve","stats","name","isDirectory","chownr","withFileTypes","children","length","len","errState","then","forEach","chownrKidSync","lstatSync","chownrSync","sync","mkdirsSync","utimesMillisSync","stat","copySync","src","dest","opts","filter","clobber","overwrite","preserveTimestamps","arch","console","warn","checkPathsSync","checkParentPathsSync","srcStat","handleFilterAndCopy","destStat","destParent","dirname","existsSync","startCopy","getStats","statSync","dereference","onDir","isFile","isCharacterDevice","isBlockDevice","onFile","isSymbolicLink","onLink","copyFile","mayCopyFile","unlinkSync","errorOnExist","Error","copyFileSync","handleTimestamps","mode","setDestMode","srcMode","fileIsNotWritable","makeFileWritable","setDestTimestamps","chmodSync","updatedSrcStat","atime","mtime","mkDirAndCopy","copyDir","mkdirSync","item","copyDirItem","srcItem","join","destItem","resolvedSrc","readlinkSync","cwd","symlinkSync","resolvedDest","err","isSrcSubdir","copyLink","mkdirs","pathExists","utimesMillis","copy","checkPaths","checkParentPaths","handleFilter","checkParentDir","dirExists","onInclude","Promise","include","error","unlink","handleTimestampsAndMode","setDestTimestampsAndMode","chmod","mkdir","items","copyDirItems","pop","readlink","symlink","u","remove","emptyDir","dir","callback","deleteItem","emptyDirSync","removeSync","emptydirSync","emptydir","createFile","file","makeFile","writeFile","createFileSync","writeFileSync","link","ensureFile","ensureFileSync","createLink","createLinkSync","ensureLink","ensureLinkSync","createSymlink","createSymlinkSync","ensureSymlink","ensureSymlinkSync","srcpath","dstpath","makeLink","destinationExists","message","replace","undefined","linkSync","symlinkPaths","isAbsolute","toCwd","toDst","dstdir","relativeToDst","exists","relative","symlinkPathsSync","symlinkType","type","symlinkTypeSync","_mkdirs","_symlinkPaths","_symlinkType","api","key","Object","keys","method","filename","read","fd","buffer","offset","position","reject","bytesRead","write","args","bytesWritten","writev","buffers","realpath","native","getOwnPropertyDescriptor","defineProperty","promises","jsonFile","outputJson","outputJsonSync","outputJSON","outputJSONSync","writeJSON","writeJson","writeJSONSync","writeJsonSync","readJSON","readJson","readJSONSync","readJsonSync","readFile","readFileSync","data","str","stringify","outputFileSync","async","outputFile","makeDir","_makeDir","makeDirSync","mkdirp","mkdirpSync","ensureDir","ensureDirSync","atLeastNode","useNativeRecursiveOption","checkPath","pth","platform","pathHasInvalidWinCharacters","parse","root","processOptions","defaults","permissionError","errno","syscall","input","recursive","make","includes","moveSync","doRename","rename","renameSync","moveAcrossDevice","move","destExists","encoding","itDoes","access","catch","pathExistsSync","rimraf","assert","isWindows","methods","m","maxBusyTries","busyTries","strictEqual","rimraf_","CB","time","setTimeout","st","fixWinEPERM","rmdir","er2","er3","fixWinEPERMSync","rmdirSync","originalEr","rmkids","files","f","rimrafSync","rmkidsSync","startTime","Date","now","ret","util","nodeSupportsBigInt","bigint","all","getStatsSync","funcName","callbackify","areIdentical","errMsg","srcParent","ino","dev","Number","MAX_SAFE_INTEGER","size","nlink","atimeMs","mtimeMs","ctimeMs","birthtimeMs","srcArr","sep","i","destArr","reduce","acc","cur","open","futimes","futimesErr","close","closeErr","openSync","futimesSync","closeSync","fn","apply","this","call","res","value","slice","MiniPass","EE","binding","FSReqWrap","FSReqCallback","iovec","pos","done","bw","req","oncomplete","writeBuffers","_autoClose","Symbol","_close","_ended","_fd","_finished","_flags","_flush","_handleChunk","_makeBuf","_mode","_needDrain","_onerror","_onopen","_onread","_onwrite","_open","_path","_pos","_queue","_read","_readSize","_reading","_remain","_size","_write","_writing","_defaultFlag","_errored","ReadStream","opt","super","readable","writable","TypeError","readSize","Infinity","autoClose","emit","Buffer","allocUnsafe","Math","min","buf","nextTick","br","end","ev","ReadStreamSync","threw","readSync","WriteStream","start","defaultFlag","flags","enc","from","push","WriteStreamSync","writeSync","clone","getPrototypeOf","obj","__proto__","create","getOwnPropertyNames","polyfills","legacy","gracefulQueue","previousSymbol","for","noop","publishQueue","context","queue","get","debug","debuglog","env","NODE_DEBUG","format","arguments","global","fs$close","retry","fs$closeSync","on","patch","TEST_GRACEFUL_FS_GLOBAL_PATCH","__patched","gracefulify","createReadStream","createWriteStream","fs$readFile","go$readFile","enqueue","fs$writeFile","go$writeFile","fs$appendFile","appendFile","go$appendFile","fs$copyFile","fs$readdir","go$readdir$cb","go$readdir","sort","substr","legStreams","fs$ReadStream","prototype","ReadStream$open","fs$WriteStream","WriteStream$open","set","val","enumerable","configurable","FileReadStream","FileWriteStream","that","destroy","fs$open","go$open","elem","shift","Stream","self","paused","bufferSize","index","setEncoding","busy","flush","constants","origCwd","GRACEFUL_FS_PLATFORM","chdir","d","setPrototypeOf","hasOwnProperty","patchLchmod","lutimes","patchLutimes","chownFix","fchown","chmodFix","fchmod","lchmod","chownFixSync","fchownSync","chmodFixSync","fchmodSync","lchmodSync","statFix","fstat","statFixSync","fstatSync","fs$rename","to","backoff","stater","fs$read","callback_","eagCounter","fs$readSync","O_WRONLY","O_SYMLINK","err2","at","mt","lutimesSync","_a","_b","_c","orig","target","chownErOk","nonroot","getuid","_fs","universalify","_readFile","shouldThrow","throws","fromCallback","stripBom","JSON","reviver","fromPromise","content","_writeFile","jsonfile","EOF","finalEOL","EOL","replacer","spaces","isBuffer","toString","helpers","ValidatorResult","SchemaError","attribute","ignoreProperties","validators","validateType","instance","schema","ctx","result","types","Array","isArray","some","testType","bind","list","v","id","$id","addError","argument","testSchemaNoThrow","throwError","throwAll","validateSchema","valid","Function","anyOf","validateAnyOf","inner","importErrors","title","nestedErrors","allOf","validateAllOf","msg","errors","oneOf","validateOneOf","count","if","validateIf","isSchema","ifValid","makeChild","else","getEnumerableProperty","object","propertyIsEnumerable","propertyNames","validatePropertyNames","subschema","property","properties","validateProperties","preValidateProperty","prop","testAdditionalProperty","additionalProperties","patternProperties","validatePatternProperties","pattern","regexp","RegExp","_e","validateAdditionalProperties","minProperties","validateMinProperties","maxProperties","validateMaxProperties","validateItems","array","every","additionalItems","minimum","validateMinimum","number","exclusiveMinimum","maximum","validateMaximum","exclusiveMaximum","validateExclusiveMinimum","validateExclusiveMaximum","validateMultipleOfOrDivisbleBy","validationType","errorMessage","validationArgument","instanceDecimals","getDecimalPlaces","divisorDecimals","maxDecimals","max","multiplier","pow","round","multipleOf","validateMultipleOf","divisibleBy","validateDivisibleBy","required","validateRequired","validatePattern","string","validateFormat","disableFormat","isFormat","minLength","validateMinLength","hsp","maxLength","validateMaxLength","minItems","validateMinItems","maxItems","validateMaxItems","testArrays","a","j","deepCompareStrict","uniqueItems","validateUniqueItems","dependencies","validateDependencies","dep","childContext","propertyPath","validateEnum","String","not","disallow","validateNot","notTypes","schemaId","uri","ValidationError","sum","makeSuffix","stack","throwFirst","detail","ValidatorResultError","validatorType","stringizer","captureStackTrace","constructor","SchemaContext","base","schemas","propertyName","concat","FORMAT_REGEXPS","parseFloat","isNaN","e","regex","ipv4","validator","customFormats","b","aKeys","bKeys","deepMerger","dst","deepMerge","indexOf","copyist","copyistWithDeepMerge","objectGetPath","o","s","parts","k","decodeURIComponent","pathEncoder","encodeURIComponent","encodePath","encodePointer","decimalPlaces","decimalParts","Validator","SchemaScanResult","scan","validate","urilib","found","ref","scanSchema","baseuri","$ref","resolvedUri","ourBase","substring","scanArray","extends","scanObject","definitions","anonymousBase","unresolvedRefs","attributes","addSchema","ourUri","addSubSchemaArray","addSubSchema","addSubSchemaObject","setSchemas","getSchema","urn","sch","shouldResolve","schemaobj","schemaTraverser","superResolve","switchSchema","resolved","subctx","skipAttributes","validatorErr","allowUnknownAttributes","rewrite","parsed","fragment","hash","document","testString","testNumber","isFinite","integer","testInteger","boolean","testBoolean","testArray","testNull","date","testDate","any","testAny","testObject","Yallist","SD","MAYBE_EMIT_END","EMITTED_END","EMITTING_END","CLOSED","READ","FLUSH","FLUSHCHUNK","ENCODING","DECODER","FLOWING","PAUSED","RESUME","BUFFERLENGTH","BUFFERPUSH","BUFFERSHIFT","OBJECTMODE","DESTROYED","doIter","_MP_NO_ITERATOR_SYMBOLS_","ASYNCITERATOR","asyncIterator","ITERATOR","iterator","isEndish","isArrayBuffer","ArrayBuffer","byteLength","isArrayBufferView","isView","Minipass","pipes","objectMode","lastNeed","chunk","om","assign","byteOffset","flowing","head","once","noDrain","ended","stdout","stderr","ondrain","removeAllListeners","pause","removeListener","dataLength","promise","c","collect","next","onerr","ondata","onend","ondestroy","rej","pipe","realZlibConstants","ZLIB_VERNUM","freeze","Z_NO_FLUSH","Z_PARTIAL_FLUSH","Z_SYNC_FLUSH","Z_FULL_FLUSH","Z_FINISH","Z_BLOCK","Z_OK","Z_STREAM_END","Z_NEED_DICT","Z_ERRNO","Z_STREAM_ERROR","Z_DATA_ERROR","Z_MEM_ERROR","Z_BUF_ERROR","Z_VERSION_ERROR","Z_NO_COMPRESSION","Z_BEST_SPEED","Z_BEST_COMPRESSION","Z_DEFAULT_COMPRESSION","Z_FILTERED","Z_HUFFMAN_ONLY","Z_RLE","Z_FIXED","Z_DEFAULT_STRATEGY","DEFLATE","INFLATE","GZIP","GUNZIP","DEFLATERAW","INFLATERAW","UNZIP","BROTLI_DECODE","BROTLI_ENCODE","Z_MIN_WINDOWBITS","Z_MAX_WINDOWBITS","Z_DEFAULT_WINDOWBITS","Z_MIN_CHUNK","Z_MAX_CHUNK","Z_DEFAULT_CHUNK","Z_MIN_MEMLEVEL","Z_MAX_MEMLEVEL","Z_DEFAULT_MEMLEVEL","Z_MIN_LEVEL","Z_MAX_LEVEL","Z_DEFAULT_LEVEL","BROTLI_OPERATION_PROCESS","BROTLI_OPERATION_FLUSH","BROTLI_OPERATION_FINISH","BROTLI_OPERATION_EMIT_METADATA","BROTLI_MODE_GENERIC","BROTLI_MODE_TEXT","BROTLI_MODE_FONT","BROTLI_DEFAULT_MODE","BROTLI_MIN_QUALITY","BROTLI_MAX_QUALITY","BROTLI_DEFAULT_QUALITY","BROTLI_MIN_WINDOW_BITS","BROTLI_MAX_WINDOW_BITS","BROTLI_LARGE_MAX_WINDOW_BITS","BROTLI_DEFAULT_WINDOW","BROTLI_MIN_INPUT_BLOCK_BITS","BROTLI_MAX_INPUT_BLOCK_BITS","BROTLI_PARAM_MODE","BROTLI_PARAM_QUALITY","BROTLI_PARAM_LGWIN","BROTLI_PARAM_LGBLOCK","BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING","BROTLI_PARAM_SIZE_HINT","BROTLI_PARAM_LARGE_WINDOW","BROTLI_PARAM_NPOSTFIX","BROTLI_PARAM_NDIRECT","BROTLI_DECODER_RESULT_ERROR","BROTLI_DECODER_RESULT_SUCCESS","BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT","BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT","BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION","BROTLI_DECODER_PARAM_LARGE_WINDOW","BROTLI_DECODER_NO_ERROR","BROTLI_DECODER_SUCCESS","BROTLI_DECODER_NEEDS_MORE_INPUT","BROTLI_DECODER_NEEDS_MORE_OUTPUT","BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE","BROTLI_DECODER_ERROR_FORMAT_RESERVED","BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE","BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET","BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME","BROTLI_DECODER_ERROR_FORMAT_CL_SPACE","BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE","BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT","BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1","BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2","BROTLI_DECODER_ERROR_FORMAT_TRANSFORM","BROTLI_DECODER_ERROR_FORMAT_DICTIONARY","BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS","BROTLI_DECODER_ERROR_FORMAT_PADDING_1","BROTLI_DECODER_ERROR_FORMAT_PADDING_2","BROTLI_DECODER_ERROR_FORMAT_DISTANCE","BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET","BROTLI_DECODER_ERROR_INVALID_ARGUMENTS","BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES","BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS","BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP","BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1","BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2","BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES","BROTLI_DECODER_ERROR_UNREACHABLE","realZlib","OriginalBufferConcat","_superWrite","ZlibError","_opts","_flushFlag","_finishFlushFlag","_fullFlushFlag","_handle","_onError","_sawError","_level","_strategy","_defaultFullFlush","ZlibBase","finishFlush","reset","flushFlag","alloc","nativeHandle","originalNativeClose","originalClose","_processChunk","writeReturn","Zlib","level","strategy","params","origFlush","Deflate","Inflate","_portable","Gzip","portable","Gunzip","DeflateRaw","InflateRaw","Unzip","Brotli","BrotliCompress","BrotliDecompress","optsArg","pathArg","useNative","mkdirpNative","mkdirpManual","useNativeSync","mkdirpNativeSync","mkdirpManualSync","manual","nativeSync","manualSync","findMade","parent","statAsync","findMadeSync","made","mkdirAsync","promisify","__TESTING_MKDIRP_PLATFORM__","badWinChars","__TESTING_MKDIRP_NODE_VERSION__","versArr","hasNative","t","update","extract","Pack","Unpack","Parse","ReadEntry","WriteEntry","Header","Pax","hlo","fsm","opt_","createSync","Sync","stream","addFilesSync","addFilesAsync","charAt","noResume","onentry","entry","add","filesFilter","extractFileSync","extractFile","extractSync","Map","mapHas","has","maxReadSize","__FAKE_PLATFORM__","__FAKE_TESTING_FS__","fMapEnabled","UV_FS_O_FILEMAP","fMapLimit","fMapFlag","O_TRUNC","O_CREAT","pathModule","large","SLURP","TYPE","off","ex","gex","cksumValid","needPax","nullBlock","block","cksum","linkpath","uname","gname","devmaj","devmin","ctime","decode","decString","decNumber","decDate","prefix","prefixSize","splitPrefix","encString","encNumber","encDate","charCodeAt","pathSize","pp","basename","numToDate","num","decSmallNumber","nanNull","trim","MAXNUM","12","8","encode","encSmallNumber","octalString","padOctal","floor","getTime","NULLS","argmap","kv","isSafeInteger","encodeNegative","encodePositive","flipped","byte","onesComp","twosComp","pre","twos","Parser","onentryFunction","listFileSync","listFile","resume","SymlinkError","CwdError","umask","needChmod","doChown","processUid","processGid","preserve","cache","created","sub","mkdir_","part","onmkdir","statEr","ok","isDir","PackJob","absolute","pending","ignore","piped","zlib","WriteEntrySync","WriteEntryTar","Tar","ONSTAT","ENDED","QUEUE","CURRENT","PROCESS","PROCESSING","PROCESSJOB","JOBS","JOBDONE","ADDFSENTRY","ADDTARENTRY","STAT","READDIR","ONREADDIR","PIPE","ENTRY","ENTRYOPT","WRITEENTRYCLASS","WRITE","ONDRAIN","warner","preservePaths","strict","noPax","linkCache","statCache","readdirCache","onwarn","zip","gzip","noDirRecurse","follow","noMtime","jobs","job","entries","w","removeNode","source","PackSync","maxMetaEntrySize","Entry","gzipHeader","STATE","WRITEENTRY","READENTRY","NEXTENTRY","PROCESSENTRY","EX","GEX","META","EMITMETA","BUFFER","EMITTEDEND","EMIT","CONSUMECHUNK","CONSUMECHUNKSUB","CONSUMEBODY","CONSUMEMETA","CONSUMEHEADER","CONSUMING","BUFFERCONCAT","MAYBEEND","WRITING","ABORTED","DONE","SAW_VALID_ENTRY","SAW_NULL_BLOCK","SAW_EOF","ondone","header","remain","invalid","meta","go","emittedEnd","re","drainNow","blockRemain","extra","recoverable","abort","have","queues","reservations","getDirs","running","Set","getQueues","paths","dirs","check","q","run","clear","equal","delete","reserve","charset","comment","body","encodeBody","bodyLen","bufLen","ceil","encodeField","field","byteLen","digits","log","g","merge","parseKV","parseKVLine","line","extended","globalExtended","startBlockSize","writeLen","replaceSync","headBuf","POSITION","bufPos","bytes","h","entryBlockSize","mtimeCache","streamSync","getPos","cb_","onread","flag","onopen","wc","pathReservations","ONENTRY","CHECKFS","CHECKFS2","ISREUSABLE","MAKEFS","FILE","DIRECTORY","LINK","SYMLINK","HARDLINK","UNSUPPORTED","CHECKPATH","MKDIR","ONERROR","PENDING","PEND","UNPEND","MAYBECLOSE","SKIP","DOCHOWN","UID","GID","crypto","getFlag","neverCalled","unlinkFile","randomBytes","unlinkFileSync","uint32","transform","dirCache","preserveOwner","setOwner","getgid","forceChown","win32","newer","keep","strip","processUmask","noChmod","dmode","fmode","linkparts","fullyDone","actions","abs","utimes","tx","unsupported","UnpackSync","oner","closeError","futimeser","utimesSync","utimeser","fchowner","chowner","mtimeFilter","Base","tarCode","raw","win","char","fromCharCode","toWin","toRaw","HEADER","LSTAT","ONLSTAT","ONREAD","ONREADLINK","OPENFILE","ONOPENFILE","CLOSE","MODE","winchars","modeFix","myuid","myuser","USER","pathWarn","getType","linkKey","blockLen","writeBuf","readEntry","walker","Node","tail","l","prev","unshiftNode","pushNode","unshift","thisp","forEachReverse","getReverse","mapReverse","initial","reduceReverse","toArray","arr","toArrayReverse","sliceReverse","splice","deleteCount","nodes","insert","reverse","inserted","TOKEN_REF","TOKEN_INTERFACES","TOKEN_DATE","TOKEN_ENUM","TOKEN_MAP","TOKEN_STRUCT","isObjRef","isWireDate","isWireEnum","isWireMap","isWireStruct","isMethodOverride","isPropertyOverride","Kernel","callbackHandler","traceEnabled","assemblies","objects","ObjectTable","_typeInfoForFqn","cbs","waiting","nextid","moduleLoad","nodeRequire","sandbox","vm","createContext","setImmediate","require","_debug","pkgname","pkgver","packageDir","_getPackageDir","epkg","assm","assembly","metadata","originalUmask","tar","tarball","jsiiMetadataFile","spec","SPEC_FILE_NAME","assmSpec","closure","_execute","Assembly","_addAssembly","bin","scriptPath","script","cp","spawnSync","NODE_OPTIONS","execArgv","PATH","execPath","shell","status","signal","_create","objref","deleteObject","symbol","fqn","ti","_typeInfoForProperty","static","_findSymbol","_ensureSync","_wrapSandboxCode","_fromSandbox","immutable","_toSandbox","findObject","interfaces","propertyToGet","_findPropertyTarget","propInfo","propertyToSet","_findInvokeTarget","_toSandboxValues","parameters","returns","_typeInfoForMethod","syncInProgress","prid","_makeprid","promiseid","_req","cbid","cookie","override","invoke","callbacks","fail","sandoxResult","expectedReturnType","succeed","assemblyName","_assemblyFor","targets","naming","objectCount","typedef","kind","TypeKind","Interface","Class","Enum","tagJsiiConstructor","wire","EMPTY_OBJECT_FQN","ctor","typeinfo","classType","_validateMethodArguments","initializer","installDir","mkdtempSync","os","tmpdir","onExit","requestArgs","ctorResult","_findCtor","registerObject","overrides","overrideTypeErrorMessage","_applyMethodOverride","_applyPropertyOverride","typeFqn","_tryTypeInfoForMethod","_tryTypeInfoForProperty","CANONICAL_ANY","_defineOverridenProperty","getPropertyDescriptor","prevEnumerable","_getSuperPropertyName","_makecbid","direct","proto","methodInfo","variadic","_defineOverridenMethod","methodName","methodArgs","_fromSandboxValues","param","arg","optional","describeTypeReference","curr","components","moduleName","fqnInfo","addendum","classFqn","bases","typeInfo","isClassType","classTypeInfo","isInterfaceType","interfaceTypeInfo","baseFqn","expectedType","serTypes","serializationType","host","findSymbol","lookupType","recurse","SERIALIZERS","serializationClass","deserialize","typeRef","targetType","serialize","xs","_boxUnboxParameters","boxUnbox","desc","superProp","Script","runInContext","displayErrors","OBJID_SYMBOL","IFACES_SYMBOL","JSII_SYMBOL","jsiiTypeFqn","objectReference","tagObject","objid","managed","resolveType","existingRef","allIfaces","iface","removeRedundant","makeId","builtIn","InterfaceCollection","addFromClass","addFromInterface","removeSyncPaths","registerIfNeeded","registered","onExitHandler","SYMBOL_WIRE_TYPE","_type","optionalValue","nullAndOk","isDate","serializeDate","deserializeDate","primitiveType","isScalar","primitive","collection","CollectionKind","elementtype","PrimitiveType","Json","mapJsonValue","mapValues","toMap","enumType","enumMap","enumEntry","find","deserializeEnum","arrayType","mapType","namedType","props","propertiesOf","validateRequiredProps","isAssignable","jsiiType","namedTypeRef","declaredType","prevRef","isByReferenceOnly","mapOfAny","toISOString","lookup","enumLocator","lastIndexOf","typeName","valueName","enumValue","isPrimitiveTypeReference","Any","Boolean","isCollectionTypeReference","isUnionTypeReference","compoundTypes","flatMap","union","compareSerializationClasses","isEnumType","datatype","out","wireValue","isClassOrInterfaceType","actualTypeFqn","requiredType","actualType","actualProps","specProps","missingRequiredProps","order","descr","KernelHost","inout","kernel","eventEmitter","EventEmitter","exit","processRequest","event","listener","completeCallback","completeReq","complete","apiReq","findApi","checkIfAsyncIsAllowed","writeOkay","isPromise","writeError","noStack","apiName","InputOutput","stdio","output","writeLine","writeErrorLine","reqLine","readLine","startsWith","INPUT_BUFFER_SIZE","SyncStdio","bufferedData","readBuffer","errorFD","stdin","readFD","writeFD","writeBuffer","newData","newLinePos","SchemaVersion","Stability","isNamedTypeReference","isMethod","callable","unionType","isDeprecated","entity","docs","stability","Deprecated","NameTree","_children","nameTree","values","register","_fqn","rest","validateAssembly","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","loaded","__webpack_modules__","nmd","packageInfo","JSII_NOSTACK","JSII_DEBUG","hello"],"mappings":";;QAAAA,OAAOC,UAAUC;YACf,MAAMC,IAAIC,QAAQC,SAASC,KAAKC,MAAM,KAAKC,KAAIC,KAAKC,SAASD,GAAG;YAChEP,IAAIA,EAAEK,MAAM,KAAKC,KAAIC,KAAKC,SAASD,GAAG;YACtC,OAAON,EAAE,KAAKD,EAAE,MAAOC,EAAE,OAAOD,EAAE,OAAOC,EAAE,KA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Q,UAAU;QAK1BG,UAAU,KAAA7qD,QAAQu0B,OAAe/nB,QAAE,6BAAI;QACvCu+C,QAAQ;QACRC,SAAS;;IAGX,MAAMlC,QAAQ,IAAI,SAAAmB,YAAYC;IAC9B,MAAM9H,OAAO,IAAI,OAAAyG,WAAWC,OAAO;QAAE9tC;QAAO+uC;;IAE5C3H,KAAKjuB,KAAK,QAAQn0B,QAAQkpD,KAAKvlC,KAAK3jB;IAGpC8oD,MAAMh8C,MAAM;QAAEmgD,OAAO,GAAGzqD,QAAQ1B;;IAChCgoD,MAAM9tC,QAAQA;IAEdonC,KAAKnU","file":"lib/program.js","sourcesContent":["module.exports = r => {\n const n = process.versions.node.split('.').map(x => parseInt(x, 10))\n r = r.split('.').map(x => parseInt(x, 10))\n return n[0] > r[0] || (n[0] === r[0] && (n[1] > r[1] || (n[1] === r[1] && n[2] >= r[2])))\n}\n","'use strict'\nconst fs = require('fs')\nconst path = require('path')\n\n/* istanbul ignore next */\nconst LCHOWN = fs.lchown ? 'lchown' : 'chown'\n/* istanbul ignore next */\nconst LCHOWNSYNC = fs.lchownSync ? 'lchownSync' : 'chownSync'\n\n/* istanbul ignore next */\nconst needEISDIRHandled = fs.lchown &&\n !process.version.match(/v1[1-9]+\\./) &&\n !process.version.match(/v10\\.[6-9]/)\n\nconst lchownSync = (path, uid, gid) => {\n try {\n return fs[LCHOWNSYNC](path, uid, gid)\n } catch (er) {\n if (er.code !== 'ENOENT')\n throw er\n }\n}\n\n/* istanbul ignore next */\nconst chownSync = (path, uid, gid) => {\n try {\n return fs.chownSync(path, uid, gid)\n } catch (er) {\n if (er.code !== 'ENOENT')\n throw er\n }\n}\n\n/* istanbul ignore next */\nconst handleEISDIR =\n needEISDIRHandled ? (path, uid, gid, cb) => er => {\n // Node prior to v10 had a very questionable implementation of\n // fs.lchown, which would always try to call fs.open on a directory\n // Fall back to fs.chown in those cases.\n if (!er || er.code !== 'EISDIR')\n cb(er)\n else\n fs.chown(path, uid, gid, cb)\n }\n : (_, __, ___, cb) => cb\n\n/* istanbul ignore next */\nconst handleEISDirSync =\n needEISDIRHandled ? (path, uid, gid) => {\n try {\n return lchownSync(path, uid, gid)\n } catch (er) {\n if (er.code !== 'EISDIR')\n throw er\n chownSync(path, uid, gid)\n }\n }\n : (path, uid, gid) => lchownSync(path, uid, gid)\n\n// fs.readdir could only accept an options object as of node v6\nconst nodeVersion = process.version\nlet readdir = (path, options, cb) => fs.readdir(path, options, cb)\nlet readdirSync = (path, options) => fs.readdirSync(path, options)\n/* istanbul ignore next */\nif (/^v4\\./.test(nodeVersion))\n readdir = (path, options, cb) => fs.readdir(path, cb)\n\nconst chown = (cpath, uid, gid, cb) => {\n fs[LCHOWN](cpath, uid, gid, handleEISDIR(cpath, uid, gid, er => {\n // Skip ENOENT error\n cb(er && er.code !== 'ENOENT' ? er : null)\n }))\n}\n\nconst chownrKid = (p, child, uid, gid, cb) => {\n if (typeof child === 'string')\n return fs.lstat(path.resolve(p, child), (er, stats) => {\n // Skip ENOENT error\n if (er)\n return cb(er.code !== 'ENOENT' ? er : null)\n stats.name = child\n chownrKid(p, stats, uid, gid, cb)\n })\n\n if (child.isDirectory()) {\n chownr(path.resolve(p, child.name), uid, gid, er => {\n if (er)\n return cb(er)\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n })\n } else {\n const cpath = path.resolve(p, child.name)\n chown(cpath, uid, gid, cb)\n }\n}\n\n\nconst chownr = (p, uid, gid, cb) => {\n readdir(p, { withFileTypes: true }, (er, children) => {\n // any error other than ENOTDIR or ENOTSUP means it's not readable,\n // or doesn't exist. give up.\n if (er) {\n if (er.code === 'ENOENT')\n return cb()\n else if (er.code !== 'ENOTDIR' && er.code !== 'ENOTSUP')\n return cb(er)\n }\n if (er || !children.length)\n return chown(p, uid, gid, cb)\n\n let len = children.length\n let errState = null\n const then = er => {\n if (errState)\n return\n if (er)\n return cb(errState = er)\n if (-- len === 0)\n return chown(p, uid, gid, cb)\n }\n\n children.forEach(child => chownrKid(p, child, uid, gid, then))\n })\n}\n\nconst chownrKidSync = (p, child, uid, gid) => {\n if (typeof child === 'string') {\n try {\n const stats = fs.lstatSync(path.resolve(p, child))\n stats.name = child\n child = stats\n } catch (er) {\n if (er.code === 'ENOENT')\n return\n else\n throw er\n }\n }\n\n if (child.isDirectory())\n chownrSync(path.resolve(p, child.name), uid, gid)\n\n handleEISDirSync(path.resolve(p, child.name), uid, gid)\n}\n\nconst chownrSync = (p, uid, gid) => {\n let children\n try {\n children = readdirSync(p, { withFileTypes: true })\n } catch (er) {\n if (er.code === 'ENOENT')\n return\n else if (er.code === 'ENOTDIR' || er.code === 'ENOTSUP')\n return handleEISDirSync(p, uid, gid)\n else\n throw er\n }\n\n if (children && children.length)\n children.forEach(child => chownrKidSync(p, child, uid, gid))\n\n return handleEISDirSync(p, uid, gid)\n}\n\nmodule.exports = chownr\nchownr.sync = chownrSync\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirsSync = require('../mkdirs').mkdirsSync\nconst utimesMillisSync = require('../util/utimes').utimesMillisSync\nconst stat = require('../util/stat')\n\nfunction copySync (src, dest, opts) {\n if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n opts = opts || {}\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy')\n stat.checkParentPathsSync(src, srcStat, dest, 'copy')\n return handleFilterAndCopy(destStat, src, dest, opts)\n}\n\nfunction handleFilterAndCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n const destParent = path.dirname(dest)\n if (!fs.existsSync(destParent)) mkdirsSync(destParent)\n return startCopy(destStat, src, dest, opts)\n}\n\nfunction startCopy (destStat, src, dest, opts) {\n if (opts.filter && !opts.filter(src, dest)) return\n return getStats(destStat, src, dest, opts)\n}\n\nfunction getStats (destStat, src, dest, opts) {\n const statSync = opts.dereference ? fs.statSync : fs.lstatSync\n const srcStat = statSync(src)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts) {\n if (!destStat) return copyFile(srcStat, src, dest, opts)\n return mayCopyFile(srcStat, src, dest, opts)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts) {\n if (opts.overwrite) {\n fs.unlinkSync(dest)\n return copyFile(srcStat, src, dest, opts)\n } else if (opts.errorOnExist) {\n throw new Error(`'${dest}' already exists`)\n }\n}\n\nfunction copyFile (srcStat, src, dest, opts) {\n fs.copyFileSync(src, dest)\n if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)\n return setDestMode(dest, srcStat.mode)\n}\n\nfunction handleTimestamps (srcMode, src, dest) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)\n return setDestTimestamps(src, dest)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode) {\n return setDestMode(dest, srcMode | 0o200)\n}\n\nfunction setDestMode (dest, srcMode) {\n return fs.chmodSync(dest, srcMode)\n}\n\nfunction setDestTimestamps (src, dest) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n const updatedSrcStat = fs.statSync(src)\n return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)\n if (destStat && !destStat.isDirectory()) {\n throw new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`)\n }\n return copyDir(src, dest, opts)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts) {\n fs.mkdirSync(dest)\n copyDir(src, dest, opts)\n return setDestMode(dest, srcMode)\n}\n\nfunction copyDir (src, dest, opts) {\n fs.readdirSync(src).forEach(item => copyDirItem(item, src, dest, opts))\n}\n\nfunction copyDirItem (item, src, dest, opts) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy')\n return startCopy(destStat, srcItem, destItem, opts)\n}\n\nfunction onLink (destStat, src, dest, opts) {\n let resolvedSrc = fs.readlinkSync(src)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlinkSync(resolvedSrc, dest)\n } else {\n let resolvedDest\n try {\n resolvedDest = fs.readlinkSync(dest)\n } catch (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)\n throw err\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)\n }\n\n // prevent copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (fs.statSync(dest).isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)\n }\n return copyLink(resolvedSrc, dest)\n }\n}\n\nfunction copyLink (resolvedSrc, dest) {\n fs.unlinkSync(dest)\n return fs.symlinkSync(resolvedSrc, dest)\n}\n\nmodule.exports = copySync\n","'use strict'\n\nmodule.exports = {\n copySync: require('./copy-sync')\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdirs = require('../mkdirs').mkdirs\nconst pathExists = require('../path-exists').pathExists\nconst utimesMillis = require('../util/utimes').utimesMillis\nconst stat = require('../util/stat')\n\nfunction copy (src, dest, opts, cb) {\n if (typeof opts === 'function' && !cb) {\n cb = opts\n opts = {}\n } else if (typeof opts === 'function') {\n opts = { filter: opts }\n }\n\n cb = cb || function () {}\n opts = opts || {}\n\n opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now\n opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber\n\n // Warn about using preserveTimestamps on 32-bit node\n if (opts.preserveTimestamps && process.arch === 'ia32') {\n console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)\n }\n\n stat.checkPaths(src, dest, 'copy', (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'copy', err => {\n if (err) return cb(err)\n if (opts.filter) return handleFilter(checkParentDir, destStat, src, dest, opts, cb)\n return checkParentDir(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction checkParentDir (destStat, src, dest, opts, cb) {\n const destParent = path.dirname(dest)\n pathExists(destParent, (err, dirExists) => {\n if (err) return cb(err)\n if (dirExists) return startCopy(destStat, src, dest, opts, cb)\n mkdirs(destParent, err => {\n if (err) return cb(err)\n return startCopy(destStat, src, dest, opts, cb)\n })\n })\n}\n\nfunction handleFilter (onInclude, destStat, src, dest, opts, cb) {\n Promise.resolve(opts.filter(src, dest)).then(include => {\n if (include) return onInclude(destStat, src, dest, opts, cb)\n return cb()\n }, error => cb(error))\n}\n\nfunction startCopy (destStat, src, dest, opts, cb) {\n if (opts.filter) return handleFilter(getStats, destStat, src, dest, opts, cb)\n return getStats(destStat, src, dest, opts, cb)\n}\n\nfunction getStats (destStat, src, dest, opts, cb) {\n const stat = opts.dereference ? fs.stat : fs.lstat\n stat(src, (err, srcStat) => {\n if (err) return cb(err)\n\n if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isFile() ||\n srcStat.isCharacterDevice() ||\n srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts, cb)\n else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts, cb)\n })\n}\n\nfunction onFile (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return copyFile(srcStat, src, dest, opts, cb)\n return mayCopyFile(srcStat, src, dest, opts, cb)\n}\n\nfunction mayCopyFile (srcStat, src, dest, opts, cb) {\n if (opts.overwrite) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return copyFile(srcStat, src, dest, opts, cb)\n })\n } else if (opts.errorOnExist) {\n return cb(new Error(`'${dest}' already exists`))\n } else return cb()\n}\n\nfunction copyFile (srcStat, src, dest, opts, cb) {\n fs.copyFile(src, dest, err => {\n if (err) return cb(err)\n if (opts.preserveTimestamps) return handleTimestampsAndMode(srcStat.mode, src, dest, cb)\n return setDestMode(dest, srcStat.mode, cb)\n })\n}\n\nfunction handleTimestampsAndMode (srcMode, src, dest, cb) {\n // Make sure the file is writable before setting the timestamp\n // otherwise open fails with EPERM when invoked with 'r+'\n // (through utimes call)\n if (fileIsNotWritable(srcMode)) {\n return makeFileWritable(dest, srcMode, err => {\n if (err) return cb(err)\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n })\n }\n return setDestTimestampsAndMode(srcMode, src, dest, cb)\n}\n\nfunction fileIsNotWritable (srcMode) {\n return (srcMode & 0o200) === 0\n}\n\nfunction makeFileWritable (dest, srcMode, cb) {\n return setDestMode(dest, srcMode | 0o200, cb)\n}\n\nfunction setDestTimestampsAndMode (srcMode, src, dest, cb) {\n setDestTimestamps(src, dest, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n}\n\nfunction setDestMode (dest, srcMode, cb) {\n return fs.chmod(dest, srcMode, cb)\n}\n\nfunction setDestTimestamps (src, dest, cb) {\n // The initial srcStat.atime cannot be trusted\n // because it is modified by the read(2) system call\n // (See https://nodejs.org/api/fs.html#fs_stat_time_values)\n fs.stat(src, (err, updatedSrcStat) => {\n if (err) return cb(err)\n return utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime, cb)\n })\n}\n\nfunction onDir (srcStat, destStat, src, dest, opts, cb) {\n if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts, cb)\n if (destStat && !destStat.isDirectory()) {\n return cb(new Error(`Cannot overwrite non-directory '${dest}' with directory '${src}'.`))\n }\n return copyDir(src, dest, opts, cb)\n}\n\nfunction mkDirAndCopy (srcMode, src, dest, opts, cb) {\n fs.mkdir(dest, err => {\n if (err) return cb(err)\n copyDir(src, dest, opts, err => {\n if (err) return cb(err)\n return setDestMode(dest, srcMode, cb)\n })\n })\n}\n\nfunction copyDir (src, dest, opts, cb) {\n fs.readdir(src, (err, items) => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n}\n\nfunction copyDirItems (items, src, dest, opts, cb) {\n const item = items.pop()\n if (!item) return cb()\n return copyDirItem(items, item, src, dest, opts, cb)\n}\n\nfunction copyDirItem (items, item, src, dest, opts, cb) {\n const srcItem = path.join(src, item)\n const destItem = path.join(dest, item)\n stat.checkPaths(srcItem, destItem, 'copy', (err, stats) => {\n if (err) return cb(err)\n const { destStat } = stats\n startCopy(destStat, srcItem, destItem, opts, err => {\n if (err) return cb(err)\n return copyDirItems(items, src, dest, opts, cb)\n })\n })\n}\n\nfunction onLink (destStat, src, dest, opts, cb) {\n fs.readlink(src, (err, resolvedSrc) => {\n if (err) return cb(err)\n if (opts.dereference) {\n resolvedSrc = path.resolve(process.cwd(), resolvedSrc)\n }\n\n if (!destStat) {\n return fs.symlink(resolvedSrc, dest, cb)\n } else {\n fs.readlink(dest, (err, resolvedDest) => {\n if (err) {\n // dest exists and is a regular file or directory,\n // Windows may throw UNKNOWN error. If dest already exists,\n // fs throws error anyway, so no need to guard against it here.\n if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest, cb)\n return cb(err)\n }\n if (opts.dereference) {\n resolvedDest = path.resolve(process.cwd(), resolvedDest)\n }\n if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {\n return cb(new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`))\n }\n\n // do not copy if src is a subdir of dest since unlinking\n // dest in this case would result in removing src contents\n // and therefore a broken symlink would be created.\n if (destStat.isDirectory() && stat.isSrcSubdir(resolvedDest, resolvedSrc)) {\n return cb(new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`))\n }\n return copyLink(resolvedSrc, dest, cb)\n })\n }\n })\n}\n\nfunction copyLink (resolvedSrc, dest, cb) {\n fs.unlink(dest, err => {\n if (err) return cb(err)\n return fs.symlink(resolvedSrc, dest, cb)\n })\n}\n\nmodule.exports = copy\n","'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n copy: u(require('./copy'))\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst remove = require('../remove')\n\nconst emptyDir = u(function emptyDir (dir, callback) {\n callback = callback || function () {}\n fs.readdir(dir, (err, items) => {\n if (err) return mkdir.mkdirs(dir, callback)\n\n items = items.map(item => path.join(dir, item))\n\n deleteItem()\n\n function deleteItem () {\n const item = items.pop()\n if (!item) return callback()\n remove.remove(item, err => {\n if (err) return callback(err)\n deleteItem()\n })\n }\n })\n})\n\nfunction emptyDirSync (dir) {\n let items\n try {\n items = fs.readdirSync(dir)\n } catch {\n return mkdir.mkdirsSync(dir)\n }\n\n items.forEach(item => {\n item = path.join(dir, item)\n remove.removeSync(item)\n })\n}\n\nmodule.exports = {\n emptyDirSync,\n emptydirSync: emptyDirSync,\n emptyDir,\n emptydir: emptyDir\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\n\nfunction createFile (file, callback) {\n function makeFile () {\n fs.writeFile(file, '', err => {\n if (err) return callback(err)\n callback()\n })\n }\n\n fs.stat(file, (err, stats) => { // eslint-disable-line handle-callback-err\n if (!err && stats.isFile()) return callback()\n const dir = path.dirname(file)\n fs.stat(dir, (err, stats) => {\n if (err) {\n // if the directory doesn't exist, make it\n if (err.code === 'ENOENT') {\n return mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeFile()\n })\n }\n return callback(err)\n }\n\n if (stats.isDirectory()) makeFile()\n else {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdir(dir, err => {\n if (err) return callback(err)\n })\n }\n })\n })\n}\n\nfunction createFileSync (file) {\n let stats\n try {\n stats = fs.statSync(file)\n } catch {}\n if (stats && stats.isFile()) return\n\n const dir = path.dirname(file)\n try {\n if (!fs.statSync(dir).isDirectory()) {\n // parent is not a directory\n // This is just to cause an internal ENOTDIR error to be thrown\n fs.readdirSync(dir)\n }\n } catch (err) {\n // If the stat call above failed because the directory doesn't exist, create it\n if (err && err.code === 'ENOENT') mkdir.mkdirsSync(dir)\n else throw err\n }\n\n fs.writeFileSync(file, '')\n}\n\nmodule.exports = {\n createFile: u(createFile),\n createFileSync\n}\n","'use strict'\n\nconst file = require('./file')\nconst link = require('./link')\nconst symlink = require('./symlink')\n\nmodule.exports = {\n // file\n createFile: file.createFile,\n createFileSync: file.createFileSync,\n ensureFile: file.createFile,\n ensureFileSync: file.createFileSync,\n // link\n createLink: link.createLink,\n createLinkSync: link.createLinkSync,\n ensureLink: link.createLink,\n ensureLinkSync: link.createLinkSync,\n // symlink\n createSymlink: symlink.createSymlink,\n createSymlinkSync: symlink.createSymlinkSync,\n ensureSymlink: symlink.createSymlink,\n ensureSymlinkSync: symlink.createSymlinkSync\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction createLink (srcpath, dstpath, callback) {\n function makeLink (srcpath, dstpath) {\n fs.link(srcpath, dstpath, err => {\n if (err) return callback(err)\n callback(null)\n })\n }\n\n pathExists(dstpath, (err, destinationExists) => {\n if (err) return callback(err)\n if (destinationExists) return callback(null)\n fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n return callback(err)\n }\n\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return makeLink(srcpath, dstpath)\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n makeLink(srcpath, dstpath)\n })\n })\n })\n })\n}\n\nfunction createLinkSync (srcpath, dstpath) {\n const destinationExists = fs.existsSync(dstpath)\n if (destinationExists) return undefined\n\n try {\n fs.lstatSync(srcpath)\n } catch (err) {\n err.message = err.message.replace('lstat', 'ensureLink')\n throw err\n }\n\n const dir = path.dirname(dstpath)\n const dirExists = fs.existsSync(dir)\n if (dirExists) return fs.linkSync(srcpath, dstpath)\n mkdir.mkdirsSync(dir)\n\n return fs.linkSync(srcpath, dstpath)\n}\n\nmodule.exports = {\n createLink: u(createLink),\n createLinkSync\n}\n","'use strict'\n\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst pathExists = require('../path-exists').pathExists\n\n/**\n * Function that returns two types of paths, one relative to symlink, and one\n * relative to the current working directory. Checks if path is absolute or\n * relative. If the path is relative, this function checks if the path is\n * relative to symlink or relative to current working directory. This is an\n * initiative to find a smarter `srcpath` to supply when building symlinks.\n * This allows you to determine which path to use out of one of three possible\n * types of source paths. The first is an absolute path. This is detected by\n * `path.isAbsolute()`. When an absolute path is provided, it is checked to\n * see if it exists. If it does it's used, if not an error is returned\n * (callback)/ thrown (sync). The other two options for `srcpath` are a\n * relative url. By default Node's `fs.symlink` works by creating a symlink\n * using `dstpath` and expects the `srcpath` to be relative to the newly\n * created symlink. If you provide a `srcpath` that does not exist on the file\n * system it results in a broken symlink. To minimize this, the function\n * checks to see if the 'relative to symlink' source file exists, and if it\n * does it will use it. If it does not, it checks if there's a file that\n * exists that is relative to the current working directory, if does its used.\n * This preserves the expectations of the original fs.symlink spec and adds\n * the ability to pass in `relative to current working direcotry` paths.\n */\n\nfunction symlinkPaths (srcpath, dstpath, callback) {\n if (path.isAbsolute(srcpath)) {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: srcpath\n })\n })\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n return pathExists(relativeToDst, (err, exists) => {\n if (err) return callback(err)\n if (exists) {\n return callback(null, {\n toCwd: relativeToDst,\n toDst: srcpath\n })\n } else {\n return fs.lstat(srcpath, (err) => {\n if (err) {\n err.message = err.message.replace('lstat', 'ensureSymlink')\n return callback(err)\n }\n return callback(null, {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n })\n })\n }\n })\n }\n}\n\nfunction symlinkPathsSync (srcpath, dstpath) {\n let exists\n if (path.isAbsolute(srcpath)) {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('absolute srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: srcpath\n }\n } else {\n const dstdir = path.dirname(dstpath)\n const relativeToDst = path.join(dstdir, srcpath)\n exists = fs.existsSync(relativeToDst)\n if (exists) {\n return {\n toCwd: relativeToDst,\n toDst: srcpath\n }\n } else {\n exists = fs.existsSync(srcpath)\n if (!exists) throw new Error('relative srcpath does not exist')\n return {\n toCwd: srcpath,\n toDst: path.relative(dstdir, srcpath)\n }\n }\n }\n}\n\nmodule.exports = {\n symlinkPaths,\n symlinkPathsSync\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction symlinkType (srcpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n if (type) return callback(null, type)\n fs.lstat(srcpath, (err, stats) => {\n if (err) return callback(null, 'file')\n type = (stats && stats.isDirectory()) ? 'dir' : 'file'\n callback(null, type)\n })\n}\n\nfunction symlinkTypeSync (srcpath, type) {\n let stats\n\n if (type) return type\n try {\n stats = fs.lstatSync(srcpath)\n } catch {\n return 'file'\n }\n return (stats && stats.isDirectory()) ? 'dir' : 'file'\n}\n\nmodule.exports = {\n symlinkType,\n symlinkTypeSync\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst path = require('path')\nconst fs = require('graceful-fs')\nconst _mkdirs = require('../mkdirs')\nconst mkdirs = _mkdirs.mkdirs\nconst mkdirsSync = _mkdirs.mkdirsSync\n\nconst _symlinkPaths = require('./symlink-paths')\nconst symlinkPaths = _symlinkPaths.symlinkPaths\nconst symlinkPathsSync = _symlinkPaths.symlinkPathsSync\n\nconst _symlinkType = require('./symlink-type')\nconst symlinkType = _symlinkType.symlinkType\nconst symlinkTypeSync = _symlinkType.symlinkTypeSync\n\nconst pathExists = require('../path-exists').pathExists\n\nfunction createSymlink (srcpath, dstpath, type, callback) {\n callback = (typeof type === 'function') ? type : callback\n type = (typeof type === 'function') ? false : type\n\n pathExists(dstpath, (err, destinationExists) => {\n if (err) return callback(err)\n if (destinationExists) return callback(null)\n symlinkPaths(srcpath, dstpath, (err, relative) => {\n if (err) return callback(err)\n srcpath = relative.toDst\n symlinkType(relative.toCwd, type, (err, type) => {\n if (err) return callback(err)\n const dir = path.dirname(dstpath)\n pathExists(dir, (err, dirExists) => {\n if (err) return callback(err)\n if (dirExists) return fs.symlink(srcpath, dstpath, type, callback)\n mkdirs(dir, err => {\n if (err) return callback(err)\n fs.symlink(srcpath, dstpath, type, callback)\n })\n })\n })\n })\n })\n}\n\nfunction createSymlinkSync (srcpath, dstpath, type) {\n const destinationExists = fs.existsSync(dstpath)\n if (destinationExists) return undefined\n\n const relative = symlinkPathsSync(srcpath, dstpath)\n srcpath = relative.toDst\n type = symlinkTypeSync(relative.toCwd, type)\n const dir = path.dirname(dstpath)\n const exists = fs.existsSync(dir)\n if (exists) return fs.symlinkSync(srcpath, dstpath, type)\n mkdirsSync(dir)\n return fs.symlinkSync(srcpath, dstpath, type)\n}\n\nmodule.exports = {\n createSymlink: u(createSymlink),\n createSymlinkSync\n}\n","'use strict'\n// This is adapted from https://github.com/normalize/mz\n// Copyright (c) 2014-2016 Jonathan Ong me@jongleberry.com and Contributors\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\n\nconst api = [\n 'access',\n 'appendFile',\n 'chmod',\n 'chown',\n 'close',\n 'copyFile',\n 'fchmod',\n 'fchown',\n 'fdatasync',\n 'fstat',\n 'fsync',\n 'ftruncate',\n 'futimes',\n 'lchmod',\n 'lchown',\n 'link',\n 'lstat',\n 'mkdir',\n 'mkdtemp',\n 'open',\n 'opendir',\n 'readdir',\n 'readFile',\n 'readlink',\n 'realpath',\n 'rename',\n 'rm',\n 'rmdir',\n 'stat',\n 'symlink',\n 'truncate',\n 'unlink',\n 'utimes',\n 'writeFile'\n].filter(key => {\n // Some commands are not available on some systems. Ex:\n // fs.opendir was added in Node.js v12.12.0\n // fs.rm was added in Node.js v14.14.0\n // fs.lchown is not available on at least some Linux\n return typeof fs[key] === 'function'\n})\n\n// Export all keys:\nObject.keys(fs).forEach(key => {\n if (key === 'promises') {\n // fs.promises is a getter property that triggers ExperimentalWarning\n // Don't re-export it here, the getter is defined in \"lib/index.js\"\n return\n }\n exports[key] = fs[key]\n})\n\n// Universalify async methods:\napi.forEach(method => {\n exports[method] = u(fs[method])\n})\n\n// We differ from mz/fs in that we still ship the old, broken, fs.exists()\n// since we are a drop-in replacement for the native module\nexports.exists = function (filename, callback) {\n if (typeof callback === 'function') {\n return fs.exists(filename, callback)\n }\n return new Promise(resolve => {\n return fs.exists(filename, resolve)\n })\n}\n\n// fs.read(), fs.write(), & fs.writev() need special treatment due to multiple callback args\n\nexports.read = function (fd, buffer, offset, length, position, callback) {\n if (typeof callback === 'function') {\n return fs.read(fd, buffer, offset, length, position, callback)\n }\n return new Promise((resolve, reject) => {\n fs.read(fd, buffer, offset, length, position, (err, bytesRead, buffer) => {\n if (err) return reject(err)\n resolve({ bytesRead, buffer })\n })\n })\n}\n\n// Function signature can be\n// fs.write(fd, buffer[, offset[, length[, position]]], callback)\n// OR\n// fs.write(fd, string[, position[, encoding]], callback)\n// We need to handle both cases, so we use ...args\nexports.write = function (fd, buffer, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.write(fd, buffer, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.write(fd, buffer, ...args, (err, bytesWritten, buffer) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffer })\n })\n })\n}\n\n// fs.writev only available in Node v12.9.0+\nif (typeof fs.writev === 'function') {\n // Function signature is\n // s.writev(fd, buffers[, position], callback)\n // We need to handle the optional arg, so we use ...args\n exports.writev = function (fd, buffers, ...args) {\n if (typeof args[args.length - 1] === 'function') {\n return fs.writev(fd, buffers, ...args)\n }\n\n return new Promise((resolve, reject) => {\n fs.writev(fd, buffers, ...args, (err, bytesWritten, buffers) => {\n if (err) return reject(err)\n resolve({ bytesWritten, buffers })\n })\n })\n }\n}\n\n// fs.realpath.native only available in Node v9.2+\nif (typeof fs.realpath.native === 'function') {\n exports.realpath.native = u(fs.realpath.native)\n}\n","'use strict'\n\nmodule.exports = {\n // Export promiseified graceful-fs:\n ...require('./fs'),\n // Export extra methods:\n ...require('./copy-sync'),\n ...require('./copy'),\n ...require('./empty'),\n ...require('./ensure'),\n ...require('./json'),\n ...require('./mkdirs'),\n ...require('./move-sync'),\n ...require('./move'),\n ...require('./output'),\n ...require('./path-exists'),\n ...require('./remove')\n}\n\n// Export fs.promises as a getter property so that we don't trigger\n// ExperimentalWarning before fs.promises is actually accessed.\nconst fs = require('fs')\nif (Object.getOwnPropertyDescriptor(fs, 'promises')) {\n Object.defineProperty(module.exports, 'promises', {\n get () { return fs.promises }\n })\n}\n","'use strict'\n\nconst u = require('universalify').fromPromise\nconst jsonFile = require('./jsonfile')\n\njsonFile.outputJson = u(require('./output-json'))\njsonFile.outputJsonSync = require('./output-json-sync')\n// aliases\njsonFile.outputJSON = jsonFile.outputJson\njsonFile.outputJSONSync = jsonFile.outputJsonSync\njsonFile.writeJSON = jsonFile.writeJson\njsonFile.writeJSONSync = jsonFile.writeJsonSync\njsonFile.readJSON = jsonFile.readJson\njsonFile.readJSONSync = jsonFile.readJsonSync\n\nmodule.exports = jsonFile\n","'use strict'\n\nconst jsonFile = require('jsonfile')\n\nmodule.exports = {\n // jsonfile exports\n readJson: jsonFile.readFile,\n readJsonSync: jsonFile.readFileSync,\n writeJson: jsonFile.writeFile,\n writeJsonSync: jsonFile.writeFileSync\n}\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFileSync } = require('../output')\n\nfunction outputJsonSync (file, data, options) {\n const str = stringify(data, options)\n\n outputFileSync(file, str, options)\n}\n\nmodule.exports = outputJsonSync\n","'use strict'\n\nconst { stringify } = require('jsonfile/utils')\nconst { outputFile } = require('../output')\n\nasync function outputJson (file, data, options = {}) {\n const str = stringify(data, options)\n\n await outputFile(file, str, options)\n}\n\nmodule.exports = outputJson\n","'use strict'\nconst u = require('universalify').fromPromise\nconst { makeDir: _makeDir, makeDirSync } = require('./make-dir')\nconst makeDir = u(_makeDir)\n\nmodule.exports = {\n mkdirs: makeDir,\n mkdirsSync: makeDirSync,\n // alias\n mkdirp: makeDir,\n mkdirpSync: makeDirSync,\n ensureDir: makeDir,\n ensureDirSync: makeDirSync\n}\n","// Adapted from https://github.com/sindresorhus/make-dir\n// Copyright (c) Sindre Sorhus (sindresorhus.com)\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n'use strict'\nconst fs = require('../fs')\nconst path = require('path')\nconst atLeastNode = require('at-least-node')\n\nconst useNativeRecursiveOption = atLeastNode('10.12.0')\n\n// https://github.com/nodejs/node/issues/8987\n// https://github.com/libuv/libuv/pull/1088\nconst checkPath = pth => {\n if (process.platform === 'win32') {\n const pathHasInvalidWinCharacters = /[<>:\"|?*]/.test(pth.replace(path.parse(pth).root, ''))\n\n if (pathHasInvalidWinCharacters) {\n const error = new Error(`Path contains invalid characters: ${pth}`)\n error.code = 'EINVAL'\n throw error\n }\n }\n}\n\nconst processOptions = options => {\n const defaults = { mode: 0o777 }\n if (typeof options === 'number') options = { mode: options }\n return { ...defaults, ...options }\n}\n\nconst permissionError = pth => {\n // This replicates the exception of `fs.mkdir` with native the\n // `recusive` option when run on an invalid drive under Windows.\n const error = new Error(`operation not permitted, mkdir '${pth}'`)\n error.code = 'EPERM'\n error.errno = -4048\n error.path = pth\n error.syscall = 'mkdir'\n return error\n}\n\nmodule.exports.makeDir = async (input, options) => {\n checkPath(input)\n options = processOptions(options)\n\n if (useNativeRecursiveOption) {\n const pth = path.resolve(input)\n\n return fs.mkdir(pth, {\n mode: options.mode,\n recursive: true\n })\n }\n\n const make = async pth => {\n try {\n await fs.mkdir(pth, options.mode)\n } catch (error) {\n if (error.code === 'EPERM') {\n throw error\n }\n\n if (error.code === 'ENOENT') {\n if (path.dirname(pth) === pth) {\n throw permissionError(pth)\n }\n\n if (error.message.includes('null bytes')) {\n throw error\n }\n\n await make(path.dirname(pth))\n return make(pth)\n }\n\n try {\n const stats = await fs.stat(pth)\n if (!stats.isDirectory()) {\n // This error is never exposed to the user\n // it is caught below, and the original error is thrown\n throw new Error('The path is not a directory')\n }\n } catch {\n throw error\n }\n }\n }\n\n return make(path.resolve(input))\n}\n\nmodule.exports.makeDirSync = (input, options) => {\n checkPath(input)\n options = processOptions(options)\n\n if (useNativeRecursiveOption) {\n const pth = path.resolve(input)\n\n return fs.mkdirSync(pth, {\n mode: options.mode,\n recursive: true\n })\n }\n\n const make = pth => {\n try {\n fs.mkdirSync(pth, options.mode)\n } catch (error) {\n if (error.code === 'EPERM') {\n throw error\n }\n\n if (error.code === 'ENOENT') {\n if (path.dirname(pth) === pth) {\n throw permissionError(pth)\n }\n\n if (error.message.includes('null bytes')) {\n throw error\n }\n\n make(path.dirname(pth))\n return make(pth)\n }\n\n try {\n if (!fs.statSync(pth).isDirectory()) {\n // This error is never exposed to the user\n // it is caught below, and the original error is thrown\n throw new Error('The path is not a directory')\n }\n } catch {\n throw error\n }\n }\n }\n\n return make(path.resolve(input))\n}\n","'use strict'\n\nmodule.exports = {\n moveSync: require('./move-sync')\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copySync = require('../copy-sync').copySync\nconst removeSync = require('../remove').removeSync\nconst mkdirpSync = require('../mkdirs').mkdirpSync\nconst stat = require('../util/stat')\n\nfunction moveSync (src, dest, opts) {\n opts = opts || {}\n const overwrite = opts.overwrite || opts.clobber || false\n\n const { srcStat } = stat.checkPathsSync(src, dest, 'move')\n stat.checkParentPathsSync(src, srcStat, dest, 'move')\n mkdirpSync(path.dirname(dest))\n return doRename(src, dest, overwrite)\n}\n\nfunction doRename (src, dest, overwrite) {\n if (overwrite) {\n removeSync(dest)\n return rename(src, dest, overwrite)\n }\n if (fs.existsSync(dest)) throw new Error('dest already exists.')\n return rename(src, dest, overwrite)\n}\n\nfunction rename (src, dest, overwrite) {\n try {\n fs.renameSync(src, dest)\n } catch (err) {\n if (err.code !== 'EXDEV') throw err\n return moveAcrossDevice(src, dest, overwrite)\n }\n}\n\nfunction moveAcrossDevice (src, dest, overwrite) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copySync(src, dest, opts)\n return removeSync(src)\n}\n\nmodule.exports = moveSync\n","'use strict'\n\nconst u = require('universalify').fromCallback\nmodule.exports = {\n move: u(require('./move'))\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst copy = require('../copy').copy\nconst remove = require('../remove').remove\nconst mkdirp = require('../mkdirs').mkdirp\nconst pathExists = require('../path-exists').pathExists\nconst stat = require('../util/stat')\n\nfunction move (src, dest, opts, cb) {\n if (typeof opts === 'function') {\n cb = opts\n opts = {}\n }\n\n const overwrite = opts.overwrite || opts.clobber || false\n\n stat.checkPaths(src, dest, 'move', (err, stats) => {\n if (err) return cb(err)\n const { srcStat } = stats\n stat.checkParentPaths(src, srcStat, dest, 'move', err => {\n if (err) return cb(err)\n mkdirp(path.dirname(dest), err => {\n if (err) return cb(err)\n return doRename(src, dest, overwrite, cb)\n })\n })\n })\n}\n\nfunction doRename (src, dest, overwrite, cb) {\n if (overwrite) {\n return remove(dest, err => {\n if (err) return cb(err)\n return rename(src, dest, overwrite, cb)\n })\n }\n pathExists(dest, (err, destExists) => {\n if (err) return cb(err)\n if (destExists) return cb(new Error('dest already exists.'))\n return rename(src, dest, overwrite, cb)\n })\n}\n\nfunction rename (src, dest, overwrite, cb) {\n fs.rename(src, dest, err => {\n if (!err) return cb()\n if (err.code !== 'EXDEV') return cb(err)\n return moveAcrossDevice(src, dest, overwrite, cb)\n })\n}\n\nfunction moveAcrossDevice (src, dest, overwrite, cb) {\n const opts = {\n overwrite,\n errorOnExist: true\n }\n copy(src, dest, opts, err => {\n if (err) return cb(err)\n return remove(src, cb)\n })\n}\n\nmodule.exports = move\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst mkdir = require('../mkdirs')\nconst pathExists = require('../path-exists').pathExists\n\nfunction outputFile (file, data, encoding, callback) {\n if (typeof encoding === 'function') {\n callback = encoding\n encoding = 'utf8'\n }\n\n const dir = path.dirname(file)\n pathExists(dir, (err, itDoes) => {\n if (err) return callback(err)\n if (itDoes) return fs.writeFile(file, data, encoding, callback)\n\n mkdir.mkdirs(dir, err => {\n if (err) return callback(err)\n\n fs.writeFile(file, data, encoding, callback)\n })\n })\n}\n\nfunction outputFileSync (file, ...args) {\n const dir = path.dirname(file)\n if (fs.existsSync(dir)) {\n return fs.writeFileSync(file, ...args)\n }\n mkdir.mkdirsSync(dir)\n fs.writeFileSync(file, ...args)\n}\n\nmodule.exports = {\n outputFile: u(outputFile),\n outputFileSync\n}\n","'use strict'\nconst u = require('universalify').fromPromise\nconst fs = require('../fs')\n\nfunction pathExists (path) {\n return fs.access(path).then(() => true).catch(() => false)\n}\n\nmodule.exports = {\n pathExists: u(pathExists),\n pathExistsSync: fs.existsSync\n}\n","'use strict'\n\nconst u = require('universalify').fromCallback\nconst rimraf = require('./rimraf')\n\nmodule.exports = {\n remove: u(rimraf),\n removeSync: rimraf.sync\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\nconst path = require('path')\nconst assert = require('assert')\n\nconst isWindows = (process.platform === 'win32')\n\nfunction defaults (options) {\n const methods = [\n 'unlink',\n 'chmod',\n 'stat',\n 'lstat',\n 'rmdir',\n 'readdir'\n ]\n methods.forEach(m => {\n options[m] = options[m] || fs[m]\n m = m + 'Sync'\n options[m] = options[m] || fs[m]\n })\n\n options.maxBusyTries = options.maxBusyTries || 3\n}\n\nfunction rimraf (p, options, cb) {\n let busyTries = 0\n\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert.strictEqual(typeof cb, 'function', 'rimraf: callback function required')\n assert(options, 'rimraf: invalid options argument provided')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n defaults(options)\n\n rimraf_(p, options, function CB (er) {\n if (er) {\n if ((er.code === 'EBUSY' || er.code === 'ENOTEMPTY' || er.code === 'EPERM') &&\n busyTries < options.maxBusyTries) {\n busyTries++\n const time = busyTries * 100\n // try again, with the same exact callback as this one.\n return setTimeout(() => rimraf_(p, options, CB), time)\n }\n\n // already gone\n if (er.code === 'ENOENT') er = null\n }\n\n cb(er)\n })\n}\n\n// Two possible strategies.\n// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR\n// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR\n//\n// Both result in an extra syscall when you guess wrong. However, there\n// are likely far more normal files in the world than directories. This\n// is based on the assumption that a the average number of files per\n// directory is >= 1.\n//\n// If anyone ever complains about this, then I guess the strategy could\n// be made configurable somehow. But until then, YAGNI.\nfunction rimraf_ (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // sunos lets the root user unlink directories, which is... weird.\n // so we have to lstat here and make sure it's not a dir.\n options.lstat(p, (er, st) => {\n if (er && er.code === 'ENOENT') {\n return cb(null)\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er && er.code === 'EPERM' && isWindows) {\n return fixWinEPERM(p, options, er, cb)\n }\n\n if (st && st.isDirectory()) {\n return rmdir(p, options, er, cb)\n }\n\n options.unlink(p, er => {\n if (er) {\n if (er.code === 'ENOENT') {\n return cb(null)\n }\n if (er.code === 'EPERM') {\n return (isWindows)\n ? fixWinEPERM(p, options, er, cb)\n : rmdir(p, options, er, cb)\n }\n if (er.code === 'EISDIR') {\n return rmdir(p, options, er, cb)\n }\n }\n return cb(er)\n })\n })\n}\n\nfunction fixWinEPERM (p, options, er, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.chmod(p, 0o666, er2 => {\n if (er2) {\n cb(er2.code === 'ENOENT' ? null : er)\n } else {\n options.stat(p, (er3, stats) => {\n if (er3) {\n cb(er3.code === 'ENOENT' ? null : er)\n } else if (stats.isDirectory()) {\n rmdir(p, options, er, cb)\n } else {\n options.unlink(p, cb)\n }\n })\n }\n })\n}\n\nfunction fixWinEPERMSync (p, options, er) {\n let stats\n\n assert(p)\n assert(options)\n\n try {\n options.chmodSync(p, 0o666)\n } catch (er2) {\n if (er2.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n try {\n stats = options.statSync(p)\n } catch (er3) {\n if (er3.code === 'ENOENT') {\n return\n } else {\n throw er\n }\n }\n\n if (stats.isDirectory()) {\n rmdirSync(p, options, er)\n } else {\n options.unlinkSync(p)\n }\n}\n\nfunction rmdir (p, options, originalEr, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)\n // if we guessed wrong, and it's not a directory, then\n // raise the original error.\n options.rmdir(p, er => {\n if (er && (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM')) {\n rmkids(p, options, cb)\n } else if (er && er.code === 'ENOTDIR') {\n cb(originalEr)\n } else {\n cb(er)\n }\n })\n}\n\nfunction rmkids (p, options, cb) {\n assert(p)\n assert(options)\n assert(typeof cb === 'function')\n\n options.readdir(p, (er, files) => {\n if (er) return cb(er)\n\n let n = files.length\n let errState\n\n if (n === 0) return options.rmdir(p, cb)\n\n files.forEach(f => {\n rimraf(path.join(p, f), options, er => {\n if (errState) {\n return\n }\n if (er) return cb(errState = er)\n if (--n === 0) {\n options.rmdir(p, cb)\n }\n })\n })\n })\n}\n\n// this looks simpler, and is strictly *faster*, but will\n// tie up the JavaScript thread and fail on excessively\n// deep directory trees.\nfunction rimrafSync (p, options) {\n let st\n\n options = options || {}\n defaults(options)\n\n assert(p, 'rimraf: missing path')\n assert.strictEqual(typeof p, 'string', 'rimraf: path should be a string')\n assert(options, 'rimraf: missing options')\n assert.strictEqual(typeof options, 'object', 'rimraf: options should be object')\n\n try {\n st = options.lstatSync(p)\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n }\n\n // Windows can EPERM on stat. Life is suffering.\n if (er.code === 'EPERM' && isWindows) {\n fixWinEPERMSync(p, options, er)\n }\n }\n\n try {\n // sunos lets the root user unlink directories, which is... weird.\n if (st && st.isDirectory()) {\n rmdirSync(p, options, null)\n } else {\n options.unlinkSync(p)\n }\n } catch (er) {\n if (er.code === 'ENOENT') {\n return\n } else if (er.code === 'EPERM') {\n return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)\n } else if (er.code !== 'EISDIR') {\n throw er\n }\n rmdirSync(p, options, er)\n }\n}\n\nfunction rmdirSync (p, options, originalEr) {\n assert(p)\n assert(options)\n\n try {\n options.rmdirSync(p)\n } catch (er) {\n if (er.code === 'ENOTDIR') {\n throw originalEr\n } else if (er.code === 'ENOTEMPTY' || er.code === 'EEXIST' || er.code === 'EPERM') {\n rmkidsSync(p, options)\n } else if (er.code !== 'ENOENT') {\n throw er\n }\n }\n}\n\nfunction rmkidsSync (p, options) {\n assert(p)\n assert(options)\n options.readdirSync(p).forEach(f => rimrafSync(path.join(p, f), options))\n\n if (isWindows) {\n // We only end up here once we got ENOTEMPTY at least once, and\n // at this point, we are guaranteed to have removed all the kids.\n // So, we know that it won't be ENOENT or ENOTDIR or anything else.\n // try really hard to delete stuff on windows, because it has a\n // PROFOUNDLY annoying habit of not closing handles promptly when\n // files are deleted, resulting in spurious ENOTEMPTY errors.\n const startTime = Date.now()\n do {\n try {\n const ret = options.rmdirSync(p, options)\n return ret\n } catch {}\n } while (Date.now() - startTime < 500) // give up after 500ms\n } else {\n const ret = options.rmdirSync(p, options)\n return ret\n }\n}\n\nmodule.exports = rimraf\nrimraf.sync = rimrafSync\n","'use strict'\n\nconst fs = require('../fs')\nconst path = require('path')\nconst util = require('util')\nconst atLeastNode = require('at-least-node')\n\nconst nodeSupportsBigInt = atLeastNode('10.5.0')\nconst stat = (file) => nodeSupportsBigInt ? fs.stat(file, { bigint: true }) : fs.stat(file)\nconst statSync = (file) => nodeSupportsBigInt ? fs.statSync(file, { bigint: true }) : fs.statSync(file)\n\nfunction getStats (src, dest) {\n return Promise.all([\n stat(src),\n stat(dest).catch(err => {\n if (err.code === 'ENOENT') return null\n throw err\n })\n ]).then(([srcStat, destStat]) => ({ srcStat, destStat }))\n}\n\nfunction getStatsSync (src, dest) {\n let destStat\n const srcStat = statSync(src)\n try {\n destStat = statSync(dest)\n } catch (err) {\n if (err.code === 'ENOENT') return { srcStat, destStat: null }\n throw err\n }\n return { srcStat, destStat }\n}\n\nfunction checkPaths (src, dest, funcName, cb) {\n util.callbackify(getStats)(src, dest, (err, stats) => {\n if (err) return cb(err)\n const { srcStat, destStat } = stats\n if (destStat && areIdentical(srcStat, destStat)) {\n return cb(new Error('Source and destination must not be the same.'))\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return cb(null, { srcStat, destStat })\n })\n}\n\nfunction checkPathsSync (src, dest, funcName) {\n const { srcStat, destStat } = getStatsSync(src, dest)\n if (destStat && areIdentical(srcStat, destStat)) {\n throw new Error('Source and destination must not be the same.')\n }\n if (srcStat.isDirectory() && isSrcSubdir(src, dest)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return { srcStat, destStat }\n}\n\n// recursively check if dest parent is a subdirectory of src.\n// It works for all file types including symlinks since it\n// checks the src and dest inodes. It starts from the deepest\n// parent and stops once it reaches the src parent or the root path.\nfunction checkParentPaths (src, srcStat, dest, funcName, cb) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return cb()\n const callback = (err, destStat) => {\n if (err) {\n if (err.code === 'ENOENT') return cb()\n return cb(err)\n }\n if (areIdentical(srcStat, destStat)) {\n return cb(new Error(errMsg(src, dest, funcName)))\n }\n return checkParentPaths(src, srcStat, destParent, funcName, cb)\n }\n if (nodeSupportsBigInt) fs.stat(destParent, { bigint: true }, callback)\n else fs.stat(destParent, callback)\n}\n\nfunction checkParentPathsSync (src, srcStat, dest, funcName) {\n const srcParent = path.resolve(path.dirname(src))\n const destParent = path.resolve(path.dirname(dest))\n if (destParent === srcParent || destParent === path.parse(destParent).root) return\n let destStat\n try {\n destStat = statSync(destParent)\n } catch (err) {\n if (err.code === 'ENOENT') return\n throw err\n }\n if (areIdentical(srcStat, destStat)) {\n throw new Error(errMsg(src, dest, funcName))\n }\n return checkParentPathsSync(src, srcStat, destParent, funcName)\n}\n\nfunction areIdentical (srcStat, destStat) {\n if (destStat.ino && destStat.dev && destStat.ino === srcStat.ino && destStat.dev === srcStat.dev) {\n if (nodeSupportsBigInt || destStat.ino < Number.MAX_SAFE_INTEGER) {\n // definitive answer\n return true\n }\n // Use additional heuristics if we can't use 'bigint'.\n // Different 'ino' could be represented the same if they are >= Number.MAX_SAFE_INTEGER\n // See issue 657\n if (destStat.size === srcStat.size &&\n destStat.mode === srcStat.mode &&\n destStat.nlink === srcStat.nlink &&\n destStat.atimeMs === srcStat.atimeMs &&\n destStat.mtimeMs === srcStat.mtimeMs &&\n destStat.ctimeMs === srcStat.ctimeMs &&\n destStat.birthtimeMs === srcStat.birthtimeMs) {\n // heuristic answer\n return true\n }\n }\n return false\n}\n\n// return true if dest is a subdir of src, otherwise false.\n// It only checks the path strings.\nfunction isSrcSubdir (src, dest) {\n const srcArr = path.resolve(src).split(path.sep).filter(i => i)\n const destArr = path.resolve(dest).split(path.sep).filter(i => i)\n return srcArr.reduce((acc, cur, i) => acc && destArr[i] === cur, true)\n}\n\nfunction errMsg (src, dest, funcName) {\n return `Cannot ${funcName} '${src}' to a subdirectory of itself, '${dest}'.`\n}\n\nmodule.exports = {\n checkPaths,\n checkPathsSync,\n checkParentPaths,\n checkParentPathsSync,\n isSrcSubdir\n}\n","'use strict'\n\nconst fs = require('graceful-fs')\n\nfunction utimesMillis (path, atime, mtime, callback) {\n // if (!HAS_MILLIS_RES) return fs.utimes(path, atime, mtime, callback)\n fs.open(path, 'r+', (err, fd) => {\n if (err) return callback(err)\n fs.futimes(fd, atime, mtime, futimesErr => {\n fs.close(fd, closeErr => {\n if (callback) callback(futimesErr || closeErr)\n })\n })\n })\n}\n\nfunction utimesMillisSync (path, atime, mtime) {\n const fd = fs.openSync(path, 'r+')\n fs.futimesSync(fd, atime, mtime)\n return fs.closeSync(fd)\n}\n\nmodule.exports = {\n utimesMillis,\n utimesMillisSync\n}\n","'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n fn.call(\n this,\n ...args,\n (err, res) => (err != null) ? reject(err) : resolve(res)\n )\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)\n }, 'name', { value: fn.name })\n}\n","'use strict'\nconst MiniPass = require('minipass')\nconst EE = require('events').EventEmitter\nconst fs = require('fs')\n\nlet writev = fs.writev\n/* istanbul ignore next */\nif (!writev) {\n // This entire block can be removed if support for earlier than Node.js\n // 12.9.0 is not needed.\n const binding = process.binding('fs')\n const FSReqWrap = binding.FSReqWrap || binding.FSReqCallback\n\n writev = (fd, iovec, pos, cb) => {\n const done = (er, bw) => cb(er, bw, iovec)\n const req = new FSReqWrap()\n req.oncomplete = done\n binding.writeBuffers(fd, iovec, pos, req)\n }\n}\n\nconst _autoClose = Symbol('_autoClose')\nconst _close = Symbol('_close')\nconst _ended = Symbol('_ended')\nconst _fd = Symbol('_fd')\nconst _finished = Symbol('_finished')\nconst _flags = Symbol('_flags')\nconst _flush = Symbol('_flush')\nconst _handleChunk = Symbol('_handleChunk')\nconst _makeBuf = Symbol('_makeBuf')\nconst _mode = Symbol('_mode')\nconst _needDrain = Symbol('_needDrain')\nconst _onerror = Symbol('_onerror')\nconst _onopen = Symbol('_onopen')\nconst _onread = Symbol('_onread')\nconst _onwrite = Symbol('_onwrite')\nconst _open = Symbol('_open')\nconst _path = Symbol('_path')\nconst _pos = Symbol('_pos')\nconst _queue = Symbol('_queue')\nconst _read = Symbol('_read')\nconst _readSize = Symbol('_readSize')\nconst _reading = Symbol('_reading')\nconst _remain = Symbol('_remain')\nconst _size = Symbol('_size')\nconst _write = Symbol('_write')\nconst _writing = Symbol('_writing')\nconst _defaultFlag = Symbol('_defaultFlag')\nconst _errored = Symbol('_errored')\n\nclass ReadStream extends MiniPass {\n constructor (path, opt) {\n opt = opt || {}\n super(opt)\n\n this.readable = true\n this.writable = false\n\n if (typeof path !== 'string')\n throw new TypeError('path must be a string')\n\n this[_errored] = false\n this[_fd] = typeof opt.fd === 'number' ? opt.fd : null\n this[_path] = path\n this[_readSize] = opt.readSize || 16*1024*1024\n this[_reading] = false\n this[_size] = typeof opt.size === 'number' ? opt.size : Infinity\n this[_remain] = this[_size]\n this[_autoClose] = typeof opt.autoClose === 'boolean' ?\n opt.autoClose : true\n\n if (typeof this[_fd] === 'number')\n this[_read]()\n else\n this[_open]()\n }\n\n get fd () { return this[_fd] }\n get path () { return this[_path] }\n\n write () {\n throw new TypeError('this is a readable stream')\n }\n\n end () {\n throw new TypeError('this is a readable stream')\n }\n\n [_open] () {\n fs.open(this[_path], 'r', (er, fd) => this[_onopen](er, fd))\n }\n\n [_onopen] (er, fd) {\n if (er)\n this[_onerror](er)\n else {\n this[_fd] = fd\n this.emit('open', fd)\n this[_read]()\n }\n }\n\n [_makeBuf] () {\n return Buffer.allocUnsafe(Math.min(this[_readSize], this[_remain]))\n }\n\n [_read] () {\n if (!this[_reading]) {\n this[_reading] = true\n const buf = this[_makeBuf]()\n /* istanbul ignore if */\n if (buf.length === 0)\n return process.nextTick(() => this[_onread](null, 0, buf))\n fs.read(this[_fd], buf, 0, buf.length, null, (er, br, buf) =>\n this[_onread](er, br, buf))\n }\n }\n\n [_onread] (er, br, buf) {\n this[_reading] = false\n if (er)\n this[_onerror](er)\n else if (this[_handleChunk](br, buf))\n this[_read]()\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'))\n }\n }\n\n [_onerror] (er) {\n this[_reading] = true\n this[_close]()\n this.emit('error', er)\n }\n\n [_handleChunk] (br, buf) {\n let ret = false\n // no effect if infinite\n this[_remain] -= br\n if (br > 0)\n ret = super.write(br < buf.length ? buf.slice(0, br) : buf)\n\n if (br === 0 || this[_remain] <= 0) {\n ret = false\n this[_close]()\n super.end()\n }\n\n return ret\n }\n\n emit (ev, data) {\n switch (ev) {\n case 'prefinish':\n case 'finish':\n break\n\n case 'drain':\n if (typeof this[_fd] === 'number')\n this[_read]()\n break\n\n case 'error':\n if (this[_errored])\n return\n this[_errored] = true\n return super.emit(ev, data)\n\n default:\n return super.emit(ev, data)\n }\n }\n}\n\nclass ReadStreamSync extends ReadStream {\n [_open] () {\n let threw = true\n try {\n this[_onopen](null, fs.openSync(this[_path], 'r'))\n threw = false\n } finally {\n if (threw)\n this[_close]()\n }\n }\n\n [_read] () {\n let threw = true\n try {\n if (!this[_reading]) {\n this[_reading] = true\n do {\n const buf = this[_makeBuf]()\n /* istanbul ignore next */\n const br = buf.length === 0 ? 0\n : fs.readSync(this[_fd], buf, 0, buf.length, null)\n if (!this[_handleChunk](br, buf))\n break\n } while (true)\n this[_reading] = false\n }\n threw = false\n } finally {\n if (threw)\n this[_close]()\n }\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.closeSync(fd)\n this.emit('close')\n }\n }\n}\n\nclass WriteStream extends EE {\n constructor (path, opt) {\n opt = opt || {}\n super(opt)\n this.readable = false\n this.writable = true\n this[_errored] = false\n this[_writing] = false\n this[_ended] = false\n this[_needDrain] = false\n this[_queue] = []\n this[_path] = path\n this[_fd] = typeof opt.fd === 'number' ? opt.fd : null\n this[_mode] = opt.mode === undefined ? 0o666 : opt.mode\n this[_pos] = typeof opt.start === 'number' ? opt.start : null\n this[_autoClose] = typeof opt.autoClose === 'boolean' ?\n opt.autoClose : true\n\n // truncating makes no sense when writing into the middle\n const defaultFlag = this[_pos] !== null ? 'r+' : 'w'\n this[_defaultFlag] = opt.flags === undefined\n this[_flags] = this[_defaultFlag] ? defaultFlag : opt.flags\n\n if (this[_fd] === null)\n this[_open]()\n }\n\n emit (ev, data) {\n if (ev === 'error') {\n if (this[_errored])\n return\n this[_errored] = true\n }\n return super.emit(ev, data)\n }\n\n\n get fd () { return this[_fd] }\n get path () { return this[_path] }\n\n [_onerror] (er) {\n this[_close]()\n this[_writing] = true\n this.emit('error', er)\n }\n\n [_open] () {\n fs.open(this[_path], this[_flags], this[_mode],\n (er, fd) => this[_onopen](er, fd))\n }\n\n [_onopen] (er, fd) {\n if (this[_defaultFlag] &&\n this[_flags] === 'r+' &&\n er && er.code === 'ENOENT') {\n this[_flags] = 'w'\n this[_open]()\n } else if (er)\n this[_onerror](er)\n else {\n this[_fd] = fd\n this.emit('open', fd)\n this[_flush]()\n }\n }\n\n end (buf, enc) {\n if (buf)\n this.write(buf, enc)\n\n this[_ended] = true\n\n // synthetic after-write logic, where drain/finish live\n if (!this[_writing] && !this[_queue].length &&\n typeof this[_fd] === 'number')\n this[_onwrite](null, 0)\n return this\n }\n\n write (buf, enc) {\n if (typeof buf === 'string')\n buf = Buffer.from(buf, enc)\n\n if (this[_ended]) {\n this.emit('error', new Error('write() after end()'))\n return false\n }\n\n if (this[_fd] === null || this[_writing] || this[_queue].length) {\n this[_queue].push(buf)\n this[_needDrain] = true\n return false\n }\n\n this[_writing] = true\n this[_write](buf)\n return true\n }\n\n [_write] (buf) {\n fs.write(this[_fd], buf, 0, buf.length, this[_pos], (er, bw) =>\n this[_onwrite](er, bw))\n }\n\n [_onwrite] (er, bw) {\n if (er)\n this[_onerror](er)\n else {\n if (this[_pos] !== null)\n this[_pos] += bw\n if (this[_queue].length)\n this[_flush]()\n else {\n this[_writing] = false\n\n if (this[_ended] && !this[_finished]) {\n this[_finished] = true\n this[_close]()\n this.emit('finish')\n } else if (this[_needDrain]) {\n this[_needDrain] = false\n this.emit('drain')\n }\n }\n }\n }\n\n [_flush] () {\n if (this[_queue].length === 0) {\n if (this[_ended])\n this[_onwrite](null, 0)\n } else if (this[_queue].length === 1)\n this[_write](this[_queue].pop())\n else {\n const iovec = this[_queue]\n this[_queue] = []\n writev(this[_fd], iovec, this[_pos],\n (er, bw) => this[_onwrite](er, bw))\n }\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.close(fd, er => er ? this.emit('error', er) : this.emit('close'))\n }\n }\n}\n\nclass WriteStreamSync extends WriteStream {\n [_open] () {\n let fd\n // only wrap in a try{} block if we know we'll retry, to avoid\n // the rethrow obscuring the error's source frame in most cases.\n if (this[_defaultFlag] && this[_flags] === 'r+') {\n try {\n fd = fs.openSync(this[_path], this[_flags], this[_mode])\n } catch (er) {\n if (er.code === 'ENOENT') {\n this[_flags] = 'w'\n return this[_open]()\n } else\n throw er\n }\n } else\n fd = fs.openSync(this[_path], this[_flags], this[_mode])\n\n this[_onopen](null, fd)\n }\n\n [_close] () {\n if (this[_autoClose] && typeof this[_fd] === 'number') {\n const fd = this[_fd]\n this[_fd] = null\n fs.closeSync(fd)\n this.emit('close')\n }\n }\n\n [_write] (buf) {\n // throw the original, but try to close if it fails\n let threw = true\n try {\n this[_onwrite](null,\n fs.writeSync(this[_fd], buf, 0, buf.length, this[_pos]))\n threw = false\n } finally {\n if (threw)\n try { this[_close]() } catch (_) {}\n }\n }\n}\n\nexports.ReadStream = ReadStream\nexports.ReadStreamSync = ReadStreamSync\n\nexports.WriteStream = WriteStream\nexports.WriteStreamSync = WriteStreamSync\n","'use strict'\n\nmodule.exports = clone\n\nvar getPrototypeOf = Object.getPrototypeOf || function (obj) {\n return obj.__proto__\n}\n\nfunction clone (obj) {\n if (obj === null || typeof obj !== 'object')\n return obj\n\n if (obj instanceof Object)\n var copy = { __proto__: getPrototypeOf(obj) }\n else\n var copy = Object.create(null)\n\n Object.getOwnPropertyNames(obj).forEach(function (key) {\n Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))\n })\n\n return copy\n}\n","var fs = require('fs')\nvar polyfills = require('./polyfills.js')\nvar legacy = require('./legacy-streams.js')\nvar clone = require('./clone.js')\n\nvar util = require('util')\n\n/* istanbul ignore next - node 0.x polyfill */\nvar gracefulQueue\nvar previousSymbol\n\n/* istanbul ignore else - node 0.x polyfill */\nif (typeof Symbol === 'function' && typeof Symbol.for === 'function') {\n gracefulQueue = Symbol.for('graceful-fs.queue')\n // This is used in testing by future versions\n previousSymbol = Symbol.for('graceful-fs.previous')\n} else {\n gracefulQueue = '___graceful-fs.queue'\n previousSymbol = '___graceful-fs.previous'\n}\n\nfunction noop () {}\n\nfunction publishQueue(context, queue) {\n Object.defineProperty(context, gracefulQueue, {\n get: function() {\n return queue\n }\n })\n}\n\nvar debug = noop\nif (util.debuglog)\n debug = util.debuglog('gfs4')\nelse if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || ''))\n debug = function() {\n var m = util.format.apply(util, arguments)\n m = 'GFS4: ' + m.split(/\\n/).join('\\nGFS4: ')\n console.error(m)\n }\n\n// Once time initialization\nif (!fs[gracefulQueue]) {\n // This queue can be shared by multiple loaded instances\n var queue = global[gracefulQueue] || []\n publishQueue(fs, queue)\n\n // Patch fs.close/closeSync to shared queue version, because we need\n // to retry() whenever a close happens *anywhere* in the program.\n // This is essential when multiple graceful-fs instances are\n // in play at the same time.\n fs.close = (function (fs$close) {\n function close (fd, cb) {\n return fs$close.call(fs, fd, function (err) {\n // This function uses the graceful-fs shared queue\n if (!err) {\n retry()\n }\n\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n })\n }\n\n Object.defineProperty(close, previousSymbol, {\n value: fs$close\n })\n return close\n })(fs.close)\n\n fs.closeSync = (function (fs$closeSync) {\n function closeSync (fd) {\n // This function uses the graceful-fs shared queue\n fs$closeSync.apply(fs, arguments)\n retry()\n }\n\n Object.defineProperty(closeSync, previousSymbol, {\n value: fs$closeSync\n })\n return closeSync\n })(fs.closeSync)\n\n if (/\\bgfs4\\b/i.test(process.env.NODE_DEBUG || '')) {\n process.on('exit', function() {\n debug(fs[gracefulQueue])\n require('assert').equal(fs[gracefulQueue].length, 0)\n })\n }\n}\n\nif (!global[gracefulQueue]) {\n publishQueue(global, fs[gracefulQueue]);\n}\n\nmodule.exports = patch(clone(fs))\nif (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs.__patched) {\n module.exports = patch(fs)\n fs.__patched = true;\n}\n\nfunction patch (fs) {\n // Everything that references the open() function needs to be in here\n polyfills(fs)\n fs.gracefulify = patch\n\n fs.createReadStream = createReadStream\n fs.createWriteStream = createWriteStream\n var fs$readFile = fs.readFile\n fs.readFile = readFile\n function readFile (path, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$readFile(path, options, cb)\n\n function go$readFile (path, options, cb) {\n return fs$readFile(path, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readFile, [path, options, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n var fs$writeFile = fs.writeFile\n fs.writeFile = writeFile\n function writeFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$writeFile(path, data, options, cb)\n\n function go$writeFile (path, data, options, cb) {\n return fs$writeFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$writeFile, [path, data, options, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n var fs$appendFile = fs.appendFile\n if (fs$appendFile)\n fs.appendFile = appendFile\n function appendFile (path, data, options, cb) {\n if (typeof options === 'function')\n cb = options, options = null\n\n return go$appendFile(path, data, options, cb)\n\n function go$appendFile (path, data, options, cb) {\n return fs$appendFile(path, data, options, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$appendFile, [path, data, options, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n var fs$copyFile = fs.copyFile\n if (fs$copyFile)\n fs.copyFile = copyFile\n function copyFile (src, dest, flags, cb) {\n if (typeof flags === 'function') {\n cb = flags\n flags = 0\n }\n return fs$copyFile(src, dest, flags, function (err) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([fs$copyFile, [src, dest, flags, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n\n var fs$readdir = fs.readdir\n fs.readdir = readdir\n function readdir (path, options, cb) {\n var args = [path]\n if (typeof options !== 'function') {\n args.push(options)\n } else {\n cb = options\n }\n args.push(go$readdir$cb)\n\n return go$readdir(args)\n\n function go$readdir$cb (err, files) {\n if (files && files.sort)\n files.sort()\n\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$readdir, [args]])\n\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n }\n }\n\n function go$readdir (args) {\n return fs$readdir.apply(fs, args)\n }\n\n if (process.version.substr(0, 4) === 'v0.8') {\n var legStreams = legacy(fs)\n ReadStream = legStreams.ReadStream\n WriteStream = legStreams.WriteStream\n }\n\n var fs$ReadStream = fs.ReadStream\n if (fs$ReadStream) {\n ReadStream.prototype = Object.create(fs$ReadStream.prototype)\n ReadStream.prototype.open = ReadStream$open\n }\n\n var fs$WriteStream = fs.WriteStream\n if (fs$WriteStream) {\n WriteStream.prototype = Object.create(fs$WriteStream.prototype)\n WriteStream.prototype.open = WriteStream$open\n }\n\n Object.defineProperty(fs, 'ReadStream', {\n get: function () {\n return ReadStream\n },\n set: function (val) {\n ReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n Object.defineProperty(fs, 'WriteStream', {\n get: function () {\n return WriteStream\n },\n set: function (val) {\n WriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n // legacy names\n var FileReadStream = ReadStream\n Object.defineProperty(fs, 'FileReadStream', {\n get: function () {\n return FileReadStream\n },\n set: function (val) {\n FileReadStream = val\n },\n enumerable: true,\n configurable: true\n })\n var FileWriteStream = WriteStream\n Object.defineProperty(fs, 'FileWriteStream', {\n get: function () {\n return FileWriteStream\n },\n set: function (val) {\n FileWriteStream = val\n },\n enumerable: true,\n configurable: true\n })\n\n function ReadStream (path, options) {\n if (this instanceof ReadStream)\n return fs$ReadStream.apply(this, arguments), this\n else\n return ReadStream.apply(Object.create(ReadStream.prototype), arguments)\n }\n\n function ReadStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n if (that.autoClose)\n that.destroy()\n\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n that.read()\n }\n })\n }\n\n function WriteStream (path, options) {\n if (this instanceof WriteStream)\n return fs$WriteStream.apply(this, arguments), this\n else\n return WriteStream.apply(Object.create(WriteStream.prototype), arguments)\n }\n\n function WriteStream$open () {\n var that = this\n open(that.path, that.flags, that.mode, function (err, fd) {\n if (err) {\n that.destroy()\n that.emit('error', err)\n } else {\n that.fd = fd\n that.emit('open', fd)\n }\n })\n }\n\n function createReadStream (path, options) {\n return new fs.ReadStream(path, options)\n }\n\n function createWriteStream (path, options) {\n return new fs.WriteStream(path, options)\n }\n\n var fs$open = fs.open\n fs.open = open\n function open (path, flags, mode, cb) {\n if (typeof mode === 'function')\n cb = mode, mode = null\n\n return go$open(path, flags, mode, cb)\n\n function go$open (path, flags, mode, cb) {\n return fs$open(path, flags, mode, function (err, fd) {\n if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))\n enqueue([go$open, [path, flags, mode, cb]])\n else {\n if (typeof cb === 'function')\n cb.apply(this, arguments)\n retry()\n }\n })\n }\n }\n\n return fs\n}\n\nfunction enqueue (elem) {\n debug('ENQUEUE', elem[0].name, elem[1])\n fs[gracefulQueue].push(elem)\n}\n\nfunction retry () {\n var elem = fs[gracefulQueue].shift()\n if (elem) {\n debug('RETRY', elem[0].name, elem[1])\n elem[0].apply(null, elem[1])\n }\n}\n","var Stream = require('stream').Stream\n\nmodule.exports = legacy\n\nfunction legacy (fs) {\n return {\n ReadStream: ReadStream,\n WriteStream: WriteStream\n }\n\n function ReadStream (path, options) {\n if (!(this instanceof ReadStream)) return new ReadStream(path, options);\n\n Stream.call(this);\n\n var self = this;\n\n this.path = path;\n this.fd = null;\n this.readable = true;\n this.paused = false;\n\n this.flags = 'r';\n this.mode = 438; /*=0666*/\n this.bufferSize = 64 * 1024;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.encoding) this.setEncoding(this.encoding);\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.end === undefined) {\n this.end = Infinity;\n } else if ('number' !== typeof this.end) {\n throw TypeError('end must be a Number');\n }\n\n if (this.start > this.end) {\n throw new Error('start must be <= end');\n }\n\n this.pos = this.start;\n }\n\n if (this.fd !== null) {\n process.nextTick(function() {\n self._read();\n });\n return;\n }\n\n fs.open(this.path, this.flags, this.mode, function (err, fd) {\n if (err) {\n self.emit('error', err);\n self.readable = false;\n return;\n }\n\n self.fd = fd;\n self.emit('open', fd);\n self._read();\n })\n }\n\n function WriteStream (path, options) {\n if (!(this instanceof WriteStream)) return new WriteStream(path, options);\n\n Stream.call(this);\n\n this.path = path;\n this.fd = null;\n this.writable = true;\n\n this.flags = 'w';\n this.encoding = 'binary';\n this.mode = 438; /*=0666*/\n this.bytesWritten = 0;\n\n options = options || {};\n\n // Mixin options into this\n var keys = Object.keys(options);\n for (var index = 0, length = keys.length; index < length; index++) {\n var key = keys[index];\n this[key] = options[key];\n }\n\n if (this.start !== undefined) {\n if ('number' !== typeof this.start) {\n throw TypeError('start must be a Number');\n }\n if (this.start < 0) {\n throw new Error('start must be >= zero');\n }\n\n this.pos = this.start;\n }\n\n this.busy = false;\n this._queue = [];\n\n if (this.fd === null) {\n this._open = fs.open;\n this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);\n this.flush();\n }\n }\n}\n","var constants = require('constants')\n\nvar origCwd = process.cwd\nvar cwd = null\n\nvar platform = process.env.GRACEFUL_FS_PLATFORM || process.platform\n\nprocess.cwd = function() {\n if (!cwd)\n cwd = origCwd.call(process)\n return cwd\n}\ntry {\n process.cwd()\n} catch (er) {}\n\n// This check is needed until node.js 12 is required\nif (typeof process.chdir === 'function') {\n var chdir = process.chdir\n process.chdir = function (d) {\n cwd = null\n chdir.call(process, d)\n }\n if (Object.setPrototypeOf) Object.setPrototypeOf(process.chdir, chdir)\n}\n\nmodule.exports = patch\n\nfunction patch (fs) {\n // (re-)implement some things that are known busted or missing.\n\n // lchmod, broken prior to 0.6.2\n // back-port the fix here.\n if (constants.hasOwnProperty('O_SYMLINK') &&\n process.version.match(/^v0\\.6\\.[0-2]|^v0\\.5\\./)) {\n patchLchmod(fs)\n }\n\n // lutimes implementation, or no-op\n if (!fs.lutimes) {\n patchLutimes(fs)\n }\n\n // https://github.com/isaacs/node-graceful-fs/issues/4\n // Chown should not fail on einval or eperm if non-root.\n // It should not fail on enosys ever, as this just indicates\n // that a fs doesn't support the intended operation.\n\n fs.chown = chownFix(fs.chown)\n fs.fchown = chownFix(fs.fchown)\n fs.lchown = chownFix(fs.lchown)\n\n fs.chmod = chmodFix(fs.chmod)\n fs.fchmod = chmodFix(fs.fchmod)\n fs.lchmod = chmodFix(fs.lchmod)\n\n fs.chownSync = chownFixSync(fs.chownSync)\n fs.fchownSync = chownFixSync(fs.fchownSync)\n fs.lchownSync = chownFixSync(fs.lchownSync)\n\n fs.chmodSync = chmodFixSync(fs.chmodSync)\n fs.fchmodSync = chmodFixSync(fs.fchmodSync)\n fs.lchmodSync = chmodFixSync(fs.lchmodSync)\n\n fs.stat = statFix(fs.stat)\n fs.fstat = statFix(fs.fstat)\n fs.lstat = statFix(fs.lstat)\n\n fs.statSync = statFixSync(fs.statSync)\n fs.fstatSync = statFixSync(fs.fstatSync)\n fs.lstatSync = statFixSync(fs.lstatSync)\n\n // if lchmod/lchown do not exist, then make them no-ops\n if (!fs.lchmod) {\n fs.lchmod = function (path, mode, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchmodSync = function () {}\n }\n if (!fs.lchown) {\n fs.lchown = function (path, uid, gid, cb) {\n if (cb) process.nextTick(cb)\n }\n fs.lchownSync = function () {}\n }\n\n // on Windows, A/V software can lock the directory, causing this\n // to fail with an EACCES or EPERM if the directory contains newly\n // created files. Try again on failure, for up to 60 seconds.\n\n // Set the timeout this long because some Windows Anti-Virus, such as Parity\n // bit9, may lock files for up to a minute, causing npm package install\n // failures. Also, take care to yield the scheduler. Windows scheduling gives\n // CPU to a busy looping process, which can cause the program causing the lock\n // contention to be starved of CPU by node, so the contention doesn't resolve.\n if (platform === \"win32\") {\n fs.rename = (function (fs$rename) { return function (from, to, cb) {\n var start = Date.now()\n var backoff = 0;\n fs$rename(from, to, function CB (er) {\n if (er\n && (er.code === \"EACCES\" || er.code === \"EPERM\")\n && Date.now() - start < 60000) {\n setTimeout(function() {\n fs.stat(to, function (stater, st) {\n if (stater && stater.code === \"ENOENT\")\n fs$rename(from, to, CB);\n else\n cb(er)\n })\n }, backoff)\n if (backoff < 100)\n backoff += 10;\n return;\n }\n if (cb) cb(er)\n })\n }})(fs.rename)\n }\n\n // if read() returns EAGAIN, then just try it again.\n fs.read = (function (fs$read) {\n function read (fd, buffer, offset, length, position, callback_) {\n var callback\n if (callback_ && typeof callback_ === 'function') {\n var eagCounter = 0\n callback = function (er, _, __) {\n if (er && er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n callback_.apply(this, arguments)\n }\n }\n return fs$read.call(fs, fd, buffer, offset, length, position, callback)\n }\n\n // This ensures `util.promisify` works as it does for native `fs.read`.\n if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)\n return read\n })(fs.read)\n\n fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {\n var eagCounter = 0\n while (true) {\n try {\n return fs$readSync.call(fs, fd, buffer, offset, length, position)\n } catch (er) {\n if (er.code === 'EAGAIN' && eagCounter < 10) {\n eagCounter ++\n continue\n }\n throw er\n }\n }\n }})(fs.readSync)\n\n function patchLchmod (fs) {\n fs.lchmod = function (path, mode, callback) {\n fs.open( path\n , constants.O_WRONLY | constants.O_SYMLINK\n , mode\n , function (err, fd) {\n if (err) {\n if (callback) callback(err)\n return\n }\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n fs.fchmod(fd, mode, function (err) {\n fs.close(fd, function(err2) {\n if (callback) callback(err || err2)\n })\n })\n })\n }\n\n fs.lchmodSync = function (path, mode) {\n var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)\n\n // prefer to return the chmod error, if one occurs,\n // but still try to close, and report closing errors if they occur.\n var threw = true\n var ret\n try {\n ret = fs.fchmodSync(fd, mode)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n }\n\n function patchLutimes (fs) {\n if (constants.hasOwnProperty(\"O_SYMLINK\")) {\n fs.lutimes = function (path, at, mt, cb) {\n fs.open(path, constants.O_SYMLINK, function (er, fd) {\n if (er) {\n if (cb) cb(er)\n return\n }\n fs.futimes(fd, at, mt, function (er) {\n fs.close(fd, function (er2) {\n if (cb) cb(er || er2)\n })\n })\n })\n }\n\n fs.lutimesSync = function (path, at, mt) {\n var fd = fs.openSync(path, constants.O_SYMLINK)\n var ret\n var threw = true\n try {\n ret = fs.futimesSync(fd, at, mt)\n threw = false\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n } else {\n fs.closeSync(fd)\n }\n }\n return ret\n }\n\n } else {\n fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }\n fs.lutimesSync = function () {}\n }\n }\n\n function chmodFix (orig) {\n if (!orig) return orig\n return function (target, mode, cb) {\n return orig.call(fs, target, mode, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chmodFixSync (orig) {\n if (!orig) return orig\n return function (target, mode) {\n try {\n return orig.call(fs, target, mode)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n\n function chownFix (orig) {\n if (!orig) return orig\n return function (target, uid, gid, cb) {\n return orig.call(fs, target, uid, gid, function (er) {\n if (chownErOk(er)) er = null\n if (cb) cb.apply(this, arguments)\n })\n }\n }\n\n function chownFixSync (orig) {\n if (!orig) return orig\n return function (target, uid, gid) {\n try {\n return orig.call(fs, target, uid, gid)\n } catch (er) {\n if (!chownErOk(er)) throw er\n }\n }\n }\n\n function statFix (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = null\n }\n function callback (er, stats) {\n if (stats) {\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n }\n if (cb) cb.apply(this, arguments)\n }\n return options ? orig.call(fs, target, options, callback)\n : orig.call(fs, target, callback)\n }\n }\n\n function statFixSync (orig) {\n if (!orig) return orig\n // Older versions of Node erroneously returned signed integers for\n // uid + gid.\n return function (target, options) {\n var stats = options ? orig.call(fs, target, options)\n : orig.call(fs, target)\n if (stats.uid < 0) stats.uid += 0x100000000\n if (stats.gid < 0) stats.gid += 0x100000000\n return stats;\n }\n }\n\n // ENOSYS means that the fs doesn't support the op. Just ignore\n // that, because it doesn't matter.\n //\n // if there's no getuid, or if getuid() is something other\n // than 0, and the error is EINVAL or EPERM, then just ignore\n // it.\n //\n // This specific case is a silent failure in cp, install, tar,\n // and most other unix tools that manage permissions.\n //\n // When running as root, or if other types of errors are\n // encountered, then it's strict.\n function chownErOk (er) {\n if (!er)\n return true\n\n if (er.code === \"ENOSYS\")\n return true\n\n var nonroot = !process.getuid || process.getuid() !== 0\n if (nonroot) {\n if (er.code === \"EINVAL\" || er.code === \"EPERM\")\n return true\n }\n\n return false\n }\n}\n","let _fs\ntry {\n _fs = require('graceful-fs')\n} catch (_) {\n _fs = require('fs')\n}\nconst universalify = require('universalify')\nconst { stringify, stripBom } = require('./utils')\n\nasync function _readFile (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n let data = await universalify.fromCallback(fs.readFile)(file, options)\n\n data = stripBom(data)\n\n let obj\n try {\n obj = JSON.parse(data, options ? options.reviver : null)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n\n return obj\n}\n\nconst readFile = universalify.fromPromise(_readFile)\n\nfunction readFileSync (file, options = {}) {\n if (typeof options === 'string') {\n options = { encoding: options }\n }\n\n const fs = options.fs || _fs\n\n const shouldThrow = 'throws' in options ? options.throws : true\n\n try {\n let content = fs.readFileSync(file, options)\n content = stripBom(content)\n return JSON.parse(content, options.reviver)\n } catch (err) {\n if (shouldThrow) {\n err.message = `${file}: ${err.message}`\n throw err\n } else {\n return null\n }\n }\n}\n\nasync function _writeFile (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n\n await universalify.fromCallback(fs.writeFile)(file, str, options)\n}\n\nconst writeFile = universalify.fromPromise(_writeFile)\n\nfunction writeFileSync (file, obj, options = {}) {\n const fs = options.fs || _fs\n\n const str = stringify(obj, options)\n // not sure if fs.writeFileSync returns anything, but just in case\n return fs.writeFileSync(file, str, options)\n}\n\nconst jsonfile = {\n readFile,\n readFileSync,\n writeFile,\n writeFileSync\n}\n\nmodule.exports = jsonfile\n","'use strict'\n\nexports.fromCallback = function (fn) {\n return Object.defineProperty(function (...args) {\n if (typeof args[args.length - 1] === 'function') fn.apply(this, args)\n else {\n return new Promise((resolve, reject) => {\n fn.call(\n this,\n ...args,\n (err, res) => (err != null) ? reject(err) : resolve(res)\n )\n })\n }\n }, 'name', { value: fn.name })\n}\n\nexports.fromPromise = function (fn) {\n return Object.defineProperty(function (...args) {\n const cb = args[args.length - 1]\n if (typeof cb !== 'function') return fn.apply(this, args)\n else fn.apply(this, args.slice(0, -1)).then(r => cb(null, r), cb)\n }, 'name', { value: fn.name })\n}\n","function stringify (obj, { EOL = '\\n', finalEOL = true, replacer = null, spaces } = {}) {\n const EOF = finalEOL ? EOL : ''\n const str = JSON.stringify(obj, replacer, spaces)\n\n return str.replace(/\\n/g, EOL) + EOF\n}\n\nfunction stripBom (content) {\n // we do this because JSON.parse would convert it to a utf8 string if encoding wasn't specified\n if (Buffer.isBuffer(content)) content = content.toString('utf8')\n return content.replace(/^\\uFEFF/, '')\n}\n\nmodule.exports = { stringify, stripBom }\n","'use strict';\n\nvar helpers = require('./helpers');\n\n/** @type ValidatorResult */\nvar ValidatorResult = helpers.ValidatorResult;\n/** @type SchemaError */\nvar SchemaError = helpers.SchemaError;\n\nvar attribute = {};\n\nattribute.ignoreProperties = {\n // informative properties\n 'id': true,\n 'default': true,\n 'description': true,\n 'title': true,\n // arguments to other properties\n 'additionalItems': true,\n 'then': true,\n 'else': true,\n // special-handled properties\n '$schema': true,\n '$ref': true,\n 'extends': true,\n};\n\n/**\n * @name validators\n */\nvar validators = attribute.validators = {};\n\n/**\n * Validates whether the instance if of a certain type\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {ValidatorResult|null}\n */\nvalidators.type = function validateType (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) {\n return null;\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n var types = Array.isArray(schema.type) ? schema.type : [schema.type];\n if (!types.some(this.testType.bind(this, instance, schema, options, ctx))) {\n var list = types.map(function (v) {\n if(!v) return;\n var id = v.$id || v.id;\n return id ? ('<' + id + '>') : (v+'');\n });\n result.addError({\n name: 'type',\n argument: list,\n message: \"is not of a type(s) \" + list,\n });\n }\n return result;\n};\n\nfunction testSchemaNoThrow(instance, options, ctx, callback, schema){\n var throwError = options.throwError;\n var throwAll = options.throwAll;\n options.throwError = false;\n options.throwAll = false;\n var res = this.validateSchema(instance, schema, options, ctx);\n options.throwError = throwError;\n options.throwAll = throwAll;\n\n if (!res.valid && callback instanceof Function) {\n callback(res);\n }\n return res.valid;\n}\n\n/**\n * Validates whether the instance matches some of the given schemas\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {ValidatorResult|null}\n */\nvalidators.anyOf = function validateAnyOf (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) {\n return null;\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n var inner = new ValidatorResult(instance, schema, options, ctx);\n if (!Array.isArray(schema.anyOf)){\n throw new SchemaError(\"anyOf must be an array\");\n }\n if (!schema.anyOf.some(\n testSchemaNoThrow.bind(\n this, instance, options, ctx, function(res){inner.importErrors(res);}\n ))) {\n var list = schema.anyOf.map(function (v, i) {\n var id = v.$id || v.id;\n if(id) return '<' + id + '>';\n return(v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']';\n });\n if (options.nestedErrors) {\n result.importErrors(inner);\n }\n result.addError({\n name: 'anyOf',\n argument: list,\n message: \"is not any of \" + list.join(','),\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance matches every given schema\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null}\n */\nvalidators.allOf = function validateAllOf (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) {\n return null;\n }\n if (!Array.isArray(schema.allOf)){\n throw new SchemaError(\"allOf must be an array\");\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n var self = this;\n schema.allOf.forEach(function(v, i){\n var valid = self.validateSchema(instance, v, options, ctx);\n if(!valid.valid){\n var id = v.$id || v.id;\n var msg = id || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']';\n result.addError({\n name: 'allOf',\n argument: { id: msg, length: valid.errors.length, valid: valid },\n message: 'does not match allOf schema ' + msg + ' with ' + valid.errors.length + ' error[s]:',\n });\n result.importErrors(valid);\n }\n });\n return result;\n};\n\n/**\n * Validates whether the instance matches exactly one of the given schemas\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null}\n */\nvalidators.oneOf = function validateOneOf (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) {\n return null;\n }\n if (!Array.isArray(schema.oneOf)){\n throw new SchemaError(\"oneOf must be an array\");\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n var inner = new ValidatorResult(instance, schema, options, ctx);\n var count = schema.oneOf.filter(\n testSchemaNoThrow.bind(\n this, instance, options, ctx, function(res) {inner.importErrors(res);}\n ) ).length;\n var list = schema.oneOf.map(function (v, i) {\n var id = v.$id || v.id;\n return id || (v.title && JSON.stringify(v.title)) || (v['$ref'] && ('<' + v['$ref'] + '>')) || '[subschema '+i+']';\n });\n if (count!==1) {\n if (options.nestedErrors) {\n result.importErrors(inner);\n }\n result.addError({\n name: 'oneOf',\n argument: list,\n message: \"is not exactly one from \" + list.join(','),\n });\n }\n return result;\n};\n\n/**\n * Validates \"then\" or \"else\" depending on the result of validating \"if\"\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null}\n */\nvalidators.if = function validateIf (instance, schema, options, ctx) {\n // Ignore undefined instances\n if (instance === undefined) return null;\n if (!helpers.isSchema(schema.if)) throw new Error('Expected \"if\" keyword to be a schema');\n var ifValid = testSchemaNoThrow.call(this, instance, options, ctx, null, schema.if);\n var result = new ValidatorResult(instance, schema, options, ctx);\n var res;\n if(ifValid){\n if (schema.then === undefined) return;\n if (!helpers.isSchema(schema.then)) throw new Error('Expected \"then\" keyword to be a schema');\n res = this.validateSchema(instance, schema.then, options, ctx.makeChild(schema.then));\n result.importErrors(res);\n }else{\n if (schema.else === undefined) return;\n if (!helpers.isSchema(schema.else)) throw new Error('Expected \"else\" keyword to be a schema');\n res = this.validateSchema(instance, schema.else, options, ctx.makeChild(schema.else));\n result.importErrors(res);\n }\n return result;\n};\n\nfunction getEnumerableProperty(object, key){\n // Determine if `key` shows up in `for(var key in object)`\n // First test Object.hasOwnProperty.call as an optimization: that guarantees it does\n if(Object.hasOwnProperty.call(object, key)) return object[key];\n // Test `key in object` as an optimization; false means it won't\n if(!(key in object)) return;\n while( (object = Object.getPrototypeOf(object)) ){\n if(Object.propertyIsEnumerable.call(object, key)) return object[key];\n }\n}\n\n/**\n * Validates propertyNames\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.propertyNames = function validatePropertyNames (instance, schema, options, ctx) {\n if(!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var subschema = schema.propertyNames!==undefined ? schema.propertyNames : {};\n if(!helpers.isSchema(subschema)) throw new SchemaError('Expected \"propertyNames\" to be a schema (object or boolean)');\n\n for (var property in instance) {\n if(getEnumerableProperty(instance, property) !== undefined){\n var res = this.validateSchema(property, subschema, options, ctx.makeChild(subschema));\n result.importErrors(res);\n }\n }\n\n return result;\n};\n\n/**\n * Validates properties\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.properties = function validateProperties (instance, schema, options, ctx) {\n if(!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var properties = schema.properties || {};\n for (var property in properties) {\n var subschema = properties[property];\n if(subschema===undefined){\n continue;\n }else if(subschema===null){\n throw new SchemaError('Unexpected null, expected schema in \"properties\"');\n }\n if (typeof options.preValidateProperty == 'function') {\n options.preValidateProperty(instance, property, subschema, options, ctx);\n }\n var prop = getEnumerableProperty(instance, property);\n var res = this.validateSchema(prop, subschema, options, ctx.makeChild(subschema, property));\n if(res.instance !== result.instance[property]) result.instance[property] = res.instance;\n result.importErrors(res);\n }\n return result;\n};\n\n/**\n * Test a specific property within in instance against the additionalProperties schema attribute\n * This ignores properties with definitions in the properties schema attribute, but no other attributes.\n * If too many more types of property-existence tests pop up they may need their own class of tests (like `type` has)\n * @private\n * @return {boolean}\n */\nfunction testAdditionalProperty (instance, schema, options, ctx, property, result) {\n if(!this.types.object(instance)) return;\n if (schema.properties && schema.properties[property] !== undefined) {\n return;\n }\n if (schema.additionalProperties === false) {\n result.addError({\n name: 'additionalProperties',\n argument: property,\n message: \"is not allowed to have the additional property \" + JSON.stringify(property),\n });\n } else {\n var additionalProperties = schema.additionalProperties || {};\n\n if (typeof options.preValidateProperty == 'function') {\n options.preValidateProperty(instance, property, additionalProperties, options, ctx);\n }\n\n var res = this.validateSchema(instance[property], additionalProperties, options, ctx.makeChild(additionalProperties, property));\n if(res.instance !== result.instance[property]) result.instance[property] = res.instance;\n result.importErrors(res);\n }\n}\n\n/**\n * Validates patternProperties\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.patternProperties = function validatePatternProperties (instance, schema, options, ctx) {\n if(!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var patternProperties = schema.patternProperties || {};\n\n for (var property in instance) {\n var test = true;\n for (var pattern in patternProperties) {\n var subschema = patternProperties[pattern];\n if(subschema===undefined){\n continue;\n }else if(subschema===null){\n throw new SchemaError('Unexpected null, expected schema in \"patternProperties\"');\n }\n try {\n var regexp = new RegExp(pattern, 'u');\n } catch(_e) {\n // In the event the stricter handling causes an error, fall back on the forgiving handling\n // DEPRECATED\n regexp = new RegExp(pattern);\n }\n if (!regexp.test(property)) {\n continue;\n }\n test = false;\n\n if (typeof options.preValidateProperty == 'function') {\n options.preValidateProperty(instance, property, subschema, options, ctx);\n }\n\n var res = this.validateSchema(instance[property], subschema, options, ctx.makeChild(subschema, property));\n if(res.instance !== result.instance[property]) result.instance[property] = res.instance;\n result.importErrors(res);\n }\n if (test) {\n testAdditionalProperty.call(this, instance, schema, options, ctx, property, result);\n }\n }\n\n return result;\n};\n\n/**\n * Validates additionalProperties\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.additionalProperties = function validateAdditionalProperties (instance, schema, options, ctx) {\n if(!this.types.object(instance)) return;\n // if patternProperties is defined then we'll test when that one is called instead\n if (schema.patternProperties) {\n return null;\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n for (var property in instance) {\n testAdditionalProperty.call(this, instance, schema, options, ctx, property, result);\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is at least of a certain length, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.minProperties = function validateMinProperties (instance, schema, options, ctx) {\n if (!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var keys = Object.keys(instance);\n if (!(keys.length >= schema.minProperties)) {\n result.addError({\n name: 'minProperties',\n argument: schema.minProperties,\n message: \"does not meet minimum property length of \" + schema.minProperties,\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is at most of a certain length, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.maxProperties = function validateMaxProperties (instance, schema, options, ctx) {\n if (!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var keys = Object.keys(instance);\n if (!(keys.length <= schema.maxProperties)) {\n result.addError({\n name: 'maxProperties',\n argument: schema.maxProperties,\n message: \"does not meet maximum property length of \" + schema.maxProperties,\n });\n }\n return result;\n};\n\n/**\n * Validates items when instance is an array\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {String|null|ValidatorResult}\n */\nvalidators.items = function validateItems (instance, schema, options, ctx) {\n var self = this;\n if (!this.types.array(instance)) return;\n if (!schema.items) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n instance.every(function (value, i) {\n var items = Array.isArray(schema.items) ? (schema.items[i] || schema.additionalItems) : schema.items;\n if (items === undefined) {\n return true;\n }\n if (items === false) {\n result.addError({\n name: 'items',\n message: \"additionalItems not permitted\",\n });\n return false;\n }\n var res = self.validateSchema(value, items, options, ctx.makeChild(items, i));\n if(res.instance !== result.instance[i]) result.instance[i] = res.instance;\n result.importErrors(res);\n return true;\n });\n return result;\n};\n\n/**\n * Validates minimum and exclusiveMinimum when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.minimum = function validateMinimum (instance, schema, options, ctx) {\n if (!this.types.number(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (schema.exclusiveMinimum && schema.exclusiveMinimum === true) {\n if(!(instance > schema.minimum)){\n result.addError({\n name: 'minimum',\n argument: schema.minimum,\n message: \"must be greater than \" + schema.minimum,\n });\n }\n } else {\n if(!(instance >= schema.minimum)){\n result.addError({\n name: 'minimum',\n argument: schema.minimum,\n message: \"must be greater than or equal to \" + schema.minimum,\n });\n }\n }\n return result;\n};\n\n/**\n * Validates maximum and exclusiveMaximum when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.maximum = function validateMaximum (instance, schema, options, ctx) {\n if (!this.types.number(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (schema.exclusiveMaximum && schema.exclusiveMaximum === true) {\n if(!(instance < schema.maximum)){\n result.addError({\n name: 'maximum',\n argument: schema.maximum,\n message: \"must be less than \" + schema.maximum,\n });\n }\n } else {\n if(!(instance <= schema.maximum)){\n result.addError({\n name: 'maximum',\n argument: schema.maximum,\n message: \"must be less than or equal to \" + schema.maximum,\n });\n }\n }\n return result;\n};\n\n/**\n * Validates the number form of exclusiveMinimum when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.exclusiveMinimum = function validateExclusiveMinimum (instance, schema, options, ctx) {\n // Support the boolean form of exclusiveMinimum, which is handled by the \"minimum\" keyword.\n if(typeof schema.exclusiveMaximum === 'boolean') return;\n if (!this.types.number(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var valid = instance > schema.exclusiveMinimum;\n if (!valid) {\n result.addError({\n name: 'exclusiveMinimum',\n argument: schema.exclusiveMinimum,\n message: \"must be strictly greater than \" + schema.exclusiveMinimum,\n });\n }\n return result;\n};\n\n/**\n * Validates the number form of exclusiveMaximum when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.exclusiveMaximum = function validateExclusiveMaximum (instance, schema, options, ctx) {\n // Support the boolean form of exclusiveMaximum, which is handled by the \"maximum\" keyword.\n if(typeof schema.exclusiveMaximum === 'boolean') return;\n if (!this.types.number(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var valid = instance < schema.exclusiveMaximum;\n if (!valid) {\n result.addError({\n name: 'exclusiveMaximum',\n argument: schema.exclusiveMaximum,\n message: \"must be strictly less than \" + schema.exclusiveMaximum,\n });\n }\n return result;\n};\n\n/**\n * Perform validation for multipleOf and divisibleBy, which are essentially the same.\n * @param instance\n * @param schema\n * @param validationType\n * @param errorMessage\n * @returns {String|null}\n */\nvar validateMultipleOfOrDivisbleBy = function validateMultipleOfOrDivisbleBy (instance, schema, options, ctx, validationType, errorMessage) {\n if (!this.types.number(instance)) return;\n\n var validationArgument = schema[validationType];\n if (validationArgument == 0) {\n throw new SchemaError(validationType + \" cannot be zero\");\n }\n\n var result = new ValidatorResult(instance, schema, options, ctx);\n\n var instanceDecimals = helpers.getDecimalPlaces(instance);\n var divisorDecimals = helpers.getDecimalPlaces(validationArgument);\n\n var maxDecimals = Math.max(instanceDecimals , divisorDecimals);\n var multiplier = Math.pow(10, maxDecimals);\n\n if (Math.round(instance * multiplier) % Math.round(validationArgument * multiplier) !== 0) {\n result.addError({\n name: validationType,\n argument: validationArgument,\n message: errorMessage + JSON.stringify(validationArgument),\n });\n }\n\n return result;\n};\n\n/**\n * Validates divisibleBy when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.multipleOf = function validateMultipleOf (instance, schema, options, ctx) {\n return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, \"multipleOf\", \"is not a multiple of (divisible by) \");\n};\n\n/**\n * Validates multipleOf when the type of the instance value is a number.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.divisibleBy = function validateDivisibleBy (instance, schema, options, ctx) {\n return validateMultipleOfOrDivisbleBy.call(this, instance, schema, options, ctx, \"divisibleBy\", \"is not divisible by (multiple of) \");\n};\n\n/**\n * Validates whether the instance value is present.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.required = function validateRequired (instance, schema, options, ctx) {\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (instance === undefined && schema.required === true) {\n // A boolean form is implemented for reverse-compatibility with schemas written against older drafts\n result.addError({\n name: 'required',\n message: \"is required\",\n });\n } else if (this.types.object(instance) && Array.isArray(schema.required)) {\n schema.required.forEach(function(n){\n if(getEnumerableProperty(instance, n)===undefined){\n result.addError({\n name: 'required',\n argument: n,\n message: \"requires property \" + JSON.stringify(n),\n });\n }\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value matches the regular expression, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.pattern = function validatePattern (instance, schema, options, ctx) {\n if (!this.types.string(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var pattern = schema.pattern;\n try {\n var regexp = new RegExp(pattern, 'u');\n } catch(_e) {\n // In the event the stricter handling causes an error, fall back on the forgiving handling\n // DEPRECATED\n regexp = new RegExp(pattern);\n }\n if (!instance.match(regexp)) {\n result.addError({\n name: 'pattern',\n argument: schema.pattern,\n message: \"does not match pattern \" + JSON.stringify(schema.pattern.toString()),\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is of a certain defined format or a custom\n * format.\n * The following formats are supported for string types:\n * - date-time\n * - date\n * - time\n * - ip-address\n * - ipv6\n * - uri\n * - color\n * - host-name\n * - alpha\n * - alpha-numeric\n * - utc-millisec\n * @param instance\n * @param schema\n * @param [options]\n * @param [ctx]\n * @return {String|null}\n */\nvalidators.format = function validateFormat (instance, schema, options, ctx) {\n if (instance===undefined) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!result.disableFormat && !helpers.isFormat(instance, schema.format, this)) {\n result.addError({\n name: 'format',\n argument: schema.format,\n message: \"does not conform to the \" + JSON.stringify(schema.format) + \" format\",\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is at least of a certain length, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.minLength = function validateMinLength (instance, schema, options, ctx) {\n if (!this.types.string(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var hsp = instance.match(/[\\uDC00-\\uDFFF]/g);\n var length = instance.length - (hsp ? hsp.length : 0);\n if (!(length >= schema.minLength)) {\n result.addError({\n name: 'minLength',\n argument: schema.minLength,\n message: \"does not meet minimum length of \" + schema.minLength,\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is at most of a certain length, when the instance value is a string.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.maxLength = function validateMaxLength (instance, schema, options, ctx) {\n if (!this.types.string(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n // TODO if this was already computed in \"minLength\", use that value instead of re-computing\n var hsp = instance.match(/[\\uDC00-\\uDFFF]/g);\n var length = instance.length - (hsp ? hsp.length : 0);\n if (!(length <= schema.maxLength)) {\n result.addError({\n name: 'maxLength',\n argument: schema.maxLength,\n message: \"does not meet maximum length of \" + schema.maxLength,\n });\n }\n return result;\n};\n\n/**\n * Validates whether instance contains at least a minimum number of items, when the instance is an Array.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.minItems = function validateMinItems (instance, schema, options, ctx) {\n if (!this.types.array(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!(instance.length >= schema.minItems)) {\n result.addError({\n name: 'minItems',\n argument: schema.minItems,\n message: \"does not meet minimum length of \" + schema.minItems,\n });\n }\n return result;\n};\n\n/**\n * Validates whether instance contains no more than a maximum number of items, when the instance is an Array.\n * @param instance\n * @param schema\n * @return {String|null}\n */\nvalidators.maxItems = function validateMaxItems (instance, schema, options, ctx) {\n if (!this.types.array(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!(instance.length <= schema.maxItems)) {\n result.addError({\n name: 'maxItems',\n argument: schema.maxItems,\n message: \"does not meet maximum length of \" + schema.maxItems,\n });\n }\n return result;\n};\n\n/**\n * Deep compares arrays for duplicates\n * @param v\n * @param i\n * @param a\n * @private\n * @return {boolean}\n */\nfunction testArrays (v, i, a) {\n var j, len = a.length;\n for (j = i + 1, len; j < len; j++) {\n if (helpers.deepCompareStrict(v, a[j])) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Validates whether there are no duplicates, when the instance is an Array.\n * @param instance\n * @return {String|null}\n */\nvalidators.uniqueItems = function validateUniqueItems (instance, schema, options, ctx) {\n if (schema.uniqueItems!==true) return;\n if (!this.types.array(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!instance.every(testArrays)) {\n result.addError({\n name: 'uniqueItems',\n message: \"contains duplicate item\",\n });\n }\n return result;\n};\n\n/**\n * Validate for the presence of dependency properties, if the instance is an object.\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {null|ValidatorResult}\n */\nvalidators.dependencies = function validateDependencies (instance, schema, options, ctx) {\n if (!this.types.object(instance)) return;\n var result = new ValidatorResult(instance, schema, options, ctx);\n for (var property in schema.dependencies) {\n if (instance[property] === undefined) {\n continue;\n }\n var dep = schema.dependencies[property];\n var childContext = ctx.makeChild(dep, property);\n if (typeof dep == 'string') {\n dep = [dep];\n }\n if (Array.isArray(dep)) {\n dep.forEach(function (prop) {\n if (instance[prop] === undefined) {\n result.addError({\n // FIXME there's two different \"dependencies\" errors here with slightly different outputs\n // Can we make these the same? Or should we create different error types?\n name: 'dependencies',\n argument: childContext.propertyPath,\n message: \"property \" + prop + \" not found, required by \" + childContext.propertyPath,\n });\n }\n });\n } else {\n var res = this.validateSchema(instance, dep, options, childContext);\n if(result.instance !== res.instance) result.instance = res.instance;\n if (res && res.errors.length) {\n result.addError({\n name: 'dependencies',\n argument: childContext.propertyPath,\n message: \"does not meet dependency required by \" + childContext.propertyPath,\n });\n result.importErrors(res);\n }\n }\n }\n return result;\n};\n\n/**\n * Validates whether the instance value is one of the enumerated values.\n *\n * @param instance\n * @param schema\n * @return {ValidatorResult|null}\n */\nvalidators['enum'] = function validateEnum (instance, schema, options, ctx) {\n if (instance === undefined) {\n return null;\n }\n if (!Array.isArray(schema['enum'])) {\n throw new SchemaError(\"enum expects an array\", schema);\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!schema['enum'].some(helpers.deepCompareStrict.bind(null, instance))) {\n result.addError({\n name: 'enum',\n argument: schema['enum'],\n message: \"is not one of enum values: \" + schema['enum'].map(String).join(','),\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance exactly matches a given value\n *\n * @param instance\n * @param schema\n * @return {ValidatorResult|null}\n */\nvalidators['const'] = function validateEnum (instance, schema, options, ctx) {\n if (instance === undefined) {\n return null;\n }\n var result = new ValidatorResult(instance, schema, options, ctx);\n if (!helpers.deepCompareStrict(schema['const'], instance)) {\n result.addError({\n name: 'const',\n argument: schema['const'],\n message: \"does not exactly match expected constant: \" + schema['const'],\n });\n }\n return result;\n};\n\n/**\n * Validates whether the instance if of a prohibited type.\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @return {null|ValidatorResult}\n */\nvalidators.not = validators.disallow = function validateNot (instance, schema, options, ctx) {\n var self = this;\n if(instance===undefined) return null;\n var result = new ValidatorResult(instance, schema, options, ctx);\n var notTypes = schema.not || schema.disallow;\n if(!notTypes) return null;\n if(!Array.isArray(notTypes)) notTypes=[notTypes];\n notTypes.forEach(function (type) {\n if (self.testType(instance, schema, options, ctx, type)) {\n var id = type && (type.$id || type.id);\n var schemaId = id || type;\n result.addError({\n name: 'not',\n argument: schemaId,\n message: \"is of prohibited type \" + schemaId,\n });\n }\n });\n return result;\n};\n\nmodule.exports = attribute;\n","'use strict';\n\nvar uri = require('url');\n\nvar ValidationError = exports.ValidationError = function ValidationError (message, instance, schema, path, name, argument) {\n if(Array.isArray(path)){\n this.path = path;\n this.property = path.reduce(function(sum, item){\n return sum + makeSuffix(item);\n }, 'instance');\n }else if(path !== undefined){\n this.property = path;\n }\n if (message) {\n this.message = message;\n }\n if (schema) {\n var id = schema.$id || schema.id;\n this.schema = id || schema;\n }\n if (instance !== undefined) {\n this.instance = instance;\n }\n this.name = name;\n this.argument = argument;\n this.stack = this.toString();\n};\n\nValidationError.prototype.toString = function toString() {\n return this.property + ' ' + this.message;\n};\n\nvar ValidatorResult = exports.ValidatorResult = function ValidatorResult(instance, schema, options, ctx) {\n this.instance = instance;\n this.schema = schema;\n this.options = options;\n this.path = ctx.path;\n this.propertyPath = ctx.propertyPath;\n this.errors = [];\n this.throwError = options && options.throwError;\n this.throwFirst = options && options.throwFirst;\n this.throwAll = options && options.throwAll;\n this.disableFormat = options && options.disableFormat === true;\n};\n\nValidatorResult.prototype.addError = function addError(detail) {\n var err;\n if (typeof detail == 'string') {\n err = new ValidationError(detail, this.instance, this.schema, this.path);\n } else {\n if (!detail) throw new Error('Missing error detail');\n if (!detail.message) throw new Error('Missing error message');\n if (!detail.name) throw new Error('Missing validator type');\n err = new ValidationError(detail.message, this.instance, this.schema, this.path, detail.name, detail.argument);\n }\n\n this.errors.push(err);\n if (this.throwFirst) {\n throw new ValidatorResultError(this);\n }else if(this.throwError){\n throw err;\n }\n return err;\n};\n\nValidatorResult.prototype.importErrors = function importErrors(res) {\n if (typeof res == 'string' || (res && res.validatorType)) {\n this.addError(res);\n } else if (res && res.errors) {\n Array.prototype.push.apply(this.errors, res.errors);\n }\n};\n\nfunction stringizer (v,i){\n return i+': '+v.toString()+'\\n';\n}\nValidatorResult.prototype.toString = function toString(res) {\n return this.errors.map(stringizer).join('');\n};\n\nObject.defineProperty(ValidatorResult.prototype, \"valid\", { get: function() {\n return !this.errors.length;\n} });\n\nmodule.exports.ValidatorResultError = ValidatorResultError;\nfunction ValidatorResultError(result) {\n if(Error.captureStackTrace){\n Error.captureStackTrace(this, ValidatorResultError);\n }\n this.instance = result.instance;\n this.schema = result.schema;\n this.options = result.options;\n this.errors = result.errors;\n}\nValidatorResultError.prototype = new Error();\nValidatorResultError.prototype.constructor = ValidatorResultError;\nValidatorResultError.prototype.name = \"Validation Error\";\n\n/**\n * Describes a problem with a Schema which prevents validation of an instance\n * @name SchemaError\n * @constructor\n */\nvar SchemaError = exports.SchemaError = function SchemaError (msg, schema) {\n this.message = msg;\n this.schema = schema;\n Error.call(this, msg);\n Error.captureStackTrace(this, SchemaError);\n};\nSchemaError.prototype = Object.create(Error.prototype,\n {\n constructor: {value: SchemaError, enumerable: false},\n name: {value: 'SchemaError', enumerable: false},\n });\n\nvar SchemaContext = exports.SchemaContext = function SchemaContext (schema, options, path, base, schemas) {\n this.schema = schema;\n this.options = options;\n if(Array.isArray(path)){\n this.path = path;\n this.propertyPath = path.reduce(function(sum, item){\n return sum + makeSuffix(item);\n }, 'instance');\n }else{\n this.propertyPath = path;\n }\n this.base = base;\n this.schemas = schemas;\n};\n\nSchemaContext.prototype.resolve = function resolve (target) {\n return uri.resolve(this.base, target);\n};\n\nSchemaContext.prototype.makeChild = function makeChild(schema, propertyName){\n var path = (propertyName===undefined) ? this.path : this.path.concat([propertyName]);\n var id = schema.$id || schema.id;\n var base = uri.resolve(this.base, id||'');\n var ctx = new SchemaContext(schema, this.options, path, base, Object.create(this.schemas));\n if(id && !ctx.schemas[base]){\n ctx.schemas[base] = schema;\n }\n return ctx;\n};\n\nvar FORMAT_REGEXPS = exports.FORMAT_REGEXPS = {\n 'date-time': /^\\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\\.\\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,\n 'date': /^\\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,\n 'time': /^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,\n\n 'email': /^(?:[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\`\\{\\|\\}\\~]+\\.)*[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\`\\{\\|\\}\\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\\-](?!\\.)){0,61}[a-zA-Z0-9]?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\\[(?:(?:[01]?\\d{1,2}|2[0-4]\\d|25[0-5])\\.){3}(?:[01]?\\d{1,2}|2[0-4]\\d|25[0-5])\\]))$/,\n 'ip-address': /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,\n 'ipv6': /^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa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9A-Za-z]*:?)?$/,\n\n 'color': /^(#?([0-9A-Fa-f]{3}){1,2}\\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\\(\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*,\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*,\\s*\\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\\b\\s*\\))|(rgb\\(\\s*(\\d?\\d%|100%)+\\s*,\\s*(\\d?\\d%|100%)+\\s*,\\s*(\\d?\\d%|100%)+\\s*\\)))$/,\n\n // hostname regex from: http://stackoverflow.com/a/1420225/5628\n 'hostname': /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\\.?$/,\n 'host-name': /^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\\.?$/,\n\n 'alpha': /^[a-zA-Z]+$/,\n 'alphanumeric': /^[a-zA-Z0-9]+$/,\n 'utc-millisec': function (input) {\n return (typeof input === 'string') && parseFloat(input) === parseInt(input, 10) && !isNaN(input);\n },\n 'regex': function (input) {\n var result = true;\n try {\n new RegExp(input);\n } catch (e) {\n result = false;\n }\n return result;\n },\n 'style': /\\s*(.+?):\\s*([^;]+);?/,\n 'phone': /^\\+(?:[0-9] ?){6,14}[0-9]$/,\n};\n\nFORMAT_REGEXPS.regexp = FORMAT_REGEXPS.regex;\nFORMAT_REGEXPS.pattern = FORMAT_REGEXPS.regex;\nFORMAT_REGEXPS.ipv4 = FORMAT_REGEXPS['ip-address'];\n\nexports.isFormat = function isFormat (input, format, validator) {\n if (typeof input === 'string' && FORMAT_REGEXPS[format] !== undefined) {\n if (FORMAT_REGEXPS[format] instanceof RegExp) {\n return FORMAT_REGEXPS[format].test(input);\n }\n if (typeof FORMAT_REGEXPS[format] === 'function') {\n return FORMAT_REGEXPS[format](input);\n }\n } else if (validator && validator.customFormats &&\n typeof validator.customFormats[format] === 'function') {\n return validator.customFormats[format](input);\n }\n return true;\n};\n\nvar makeSuffix = exports.makeSuffix = function makeSuffix (key) {\n key = key.toString();\n // This function could be capable of outputting valid a ECMAScript string, but the\n // resulting code for testing which form to use would be tens of thousands of characters long\n // That means this will use the name form for some illegal forms\n if (!key.match(/[.\\s\\[\\]]/) && !key.match(/^[\\d]/)) {\n return '.' + key;\n }\n if (key.match(/^\\d+$/)) {\n return '[' + key + ']';\n }\n return '[' + JSON.stringify(key) + ']';\n};\n\nexports.deepCompareStrict = function deepCompareStrict (a, b) {\n if (typeof a !== typeof b) {\n return false;\n }\n if (Array.isArray(a)) {\n if (!Array.isArray(b)) {\n return false;\n }\n if (a.length !== b.length) {\n return false;\n }\n return a.every(function (v, i) {\n return deepCompareStrict(a[i], b[i]);\n });\n }\n if (typeof a === 'object') {\n if (!a || !b) {\n return a === b;\n }\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) {\n return false;\n }\n return aKeys.every(function (v) {\n return deepCompareStrict(a[v], b[v]);\n });\n }\n return a === b;\n};\n\nfunction deepMerger (target, dst, e, i) {\n if (typeof e === 'object') {\n dst[i] = deepMerge(target[i], e);\n } else {\n if (target.indexOf(e) === -1) {\n dst.push(e);\n }\n }\n}\n\nfunction copyist (src, dst, key) {\n dst[key] = src[key];\n}\n\nfunction copyistWithDeepMerge (target, src, dst, key) {\n if (typeof src[key] !== 'object' || !src[key]) {\n dst[key] = src[key];\n }\n else {\n if (!target[key]) {\n dst[key] = src[key];\n } else {\n dst[key] = deepMerge(target[key], src[key]);\n }\n }\n}\n\nfunction deepMerge (target, src) {\n var array = Array.isArray(src);\n var dst = array && [] || {};\n\n if (array) {\n target = target || [];\n dst = dst.concat(target);\n src.forEach(deepMerger.bind(null, target, dst));\n } else {\n if (target && typeof target === 'object') {\n Object.keys(target).forEach(copyist.bind(null, target, dst));\n }\n Object.keys(src).forEach(copyistWithDeepMerge.bind(null, target, src, dst));\n }\n\n return dst;\n}\n\nmodule.exports.deepMerge = deepMerge;\n\n/**\n * Validates instance against the provided schema\n * Implements URI+JSON Pointer encoding, e.g. \"%7e\"=\"~0\"=>\"~\", \"~1\"=\"%2f\"=>\"/\"\n * @param o\n * @param s The path to walk o along\n * @return any\n */\nexports.objectGetPath = function objectGetPath(o, s) {\n var parts = s.split('/').slice(1);\n var k;\n while (typeof (k=parts.shift()) == 'string') {\n var n = decodeURIComponent(k.replace(/~0/,'~').replace(/~1/g,'/'));\n if (!(n in o)) return;\n o = o[n];\n }\n return o;\n};\n\nfunction pathEncoder (v) {\n return '/'+encodeURIComponent(v).replace(/~/g,'%7E');\n}\n/**\n * Accept an Array of property names and return a JSON Pointer URI fragment\n * @param Array a\n * @return {String}\n */\nexports.encodePath = function encodePointer(a){\n // ~ must be encoded explicitly because hacks\n // the slash is encoded by encodeURIComponent\n return a.map(pathEncoder).join('');\n};\n\n\n/**\n * Calculate the number of decimal places a number uses\n * We need this to get correct results out of multipleOf and divisibleBy\n * when either figure is has decimal places, due to IEEE-754 float issues.\n * @param number\n * @returns {number}\n */\nexports.getDecimalPlaces = function getDecimalPlaces(number) {\n\n var decimalPlaces = 0;\n if (isNaN(number)) return decimalPlaces;\n\n if (typeof number !== 'number') {\n number = Number(number);\n }\n\n var parts = number.toString().split('e');\n if (parts.length === 2) {\n if (parts[1][0] !== '-') {\n return decimalPlaces;\n } else {\n decimalPlaces = Number(parts[1].slice(1));\n }\n }\n\n var decimalParts = parts[0].split('.');\n if (decimalParts.length === 2) {\n decimalPlaces += decimalParts[1].length;\n }\n\n return decimalPlaces;\n};\n\nexports.isSchema = function isSchema(val){\n return (typeof val === 'object' && val) || (typeof val === 'boolean');\n};\n\n","'use strict';\n\nvar Validator = module.exports.Validator = require('./validator');\n\nmodule.exports.ValidatorResult = require('./helpers').ValidatorResult;\nmodule.exports.ValidatorResultError = require('./helpers').ValidatorResultError;\nmodule.exports.ValidationError = require('./helpers').ValidationError;\nmodule.exports.SchemaError = require('./helpers').SchemaError;\nmodule.exports.SchemaScanResult = require('./scan').SchemaScanResult;\nmodule.exports.scan = require('./scan').scan;\n\nmodule.exports.validate = function (instance, schema, options) {\n var v = new Validator();\n return v.validate(instance, schema, options);\n};\n","\"use strict\";\n\nvar urilib = require('url');\nvar helpers = require('./helpers');\n\nmodule.exports.SchemaScanResult = SchemaScanResult;\nfunction SchemaScanResult(found, ref){\n this.id = found;\n this.ref = ref;\n}\n\n/**\n * Adds a schema with a certain urn to the Validator instance.\n * @param string uri\n * @param object schema\n * @return {Object}\n */\nmodule.exports.scan = function scan(base, schema){\n function scanSchema(baseuri, schema){\n if(!schema || typeof schema!='object') return;\n // Mark all referenced schemas so we can tell later which schemas are referred to, but never defined\n if(schema.$ref){\n var resolvedUri = urilib.resolve(baseuri, schema.$ref);\n ref[resolvedUri] = ref[resolvedUri] ? ref[resolvedUri]+1 : 0;\n return;\n }\n var id = schema.$id || schema.id;\n var ourBase = id ? urilib.resolve(baseuri, id) : baseuri;\n if (ourBase) {\n // If there's no fragment, append an empty one\n if(ourBase.indexOf('#')<0) ourBase += '#';\n if(found[ourBase]){\n if(!helpers.deepCompareStrict(found[ourBase], schema)){\n throw new Error('Schema <'+ourBase+'> already exists with different definition');\n }\n return found[ourBase];\n }\n found[ourBase] = schema;\n // strip trailing fragment\n if(ourBase[ourBase.length-1]=='#'){\n found[ourBase.substring(0, ourBase.length-1)] = schema;\n }\n }\n scanArray(ourBase+'/items', (Array.isArray(schema.items)?schema.items:[schema.items]));\n scanArray(ourBase+'/extends', (Array.isArray(schema.extends)?schema.extends:[schema.extends]));\n scanSchema(ourBase+'/additionalItems', schema.additionalItems);\n scanObject(ourBase+'/properties', schema.properties);\n scanSchema(ourBase+'/additionalProperties', schema.additionalProperties);\n scanObject(ourBase+'/definitions', schema.definitions);\n scanObject(ourBase+'/patternProperties', schema.patternProperties);\n scanObject(ourBase+'/dependencies', schema.dependencies);\n scanArray(ourBase+'/disallow', schema.disallow);\n scanArray(ourBase+'/allOf', schema.allOf);\n scanArray(ourBase+'/anyOf', schema.anyOf);\n scanArray(ourBase+'/oneOf', schema.oneOf);\n scanSchema(ourBase+'/not', schema.not);\n }\n function scanArray(baseuri, schemas){\n if(!Array.isArray(schemas)) return;\n for(var i=0; i\", schema);\n }\n var subschema = helpers.objectGetPath(ctx.schemas[document], fragment.substr(1));\n if(subschema===undefined){\n throw new SchemaError(\"no such schema \" + fragment + \" located in <\" + document + \">\", schema);\n }\n return {subschema: subschema, switchSchema: switchSchema};\n};\n\n/**\n * Tests whether the instance if of a certain type.\n * @private\n * @param instance\n * @param schema\n * @param options\n * @param ctx\n * @param type\n * @return {boolean}\n */\nValidator.prototype.testType = function validateType (instance, schema, options, ctx, type) {\n if(type===undefined){\n return;\n }else if(type===null){\n throw new SchemaError('Unexpected null in \"type\" keyword');\n }\n if (typeof this.types[type] == 'function') {\n return this.types[type].call(this, instance);\n }\n if (type && typeof type == 'object') {\n var res = this.validateSchema(instance, type, options, ctx);\n return res === undefined || !(res && res.errors.length);\n }\n // Undefined or properties not on the list are acceptable, same as not being defined\n return true;\n};\n\nvar types = Validator.prototype.types = {};\ntypes.string = function testString (instance) {\n return typeof instance == 'string';\n};\ntypes.number = function testNumber (instance) {\n // isFinite returns false for NaN, Infinity, and -Infinity\n return typeof instance == 'number' && isFinite(instance);\n};\ntypes.integer = function testInteger (instance) {\n return (typeof instance == 'number') && instance % 1 === 0;\n};\ntypes.boolean = function testBoolean (instance) {\n return typeof instance == 'boolean';\n};\ntypes.array = function testArray (instance) {\n return Array.isArray(instance);\n};\ntypes['null'] = function testNull (instance) {\n return instance === null;\n};\ntypes.date = function testDate (instance) {\n return instance instanceof Date;\n};\ntypes.any = function testAny (instance) {\n return true;\n};\ntypes.object = function testObject (instance) {\n // TODO: fix this - see #15\n return instance && (typeof instance === 'object') && !(Array.isArray(instance)) && !(instance instanceof Date);\n};\n\nmodule.exports = Validator;\n","'use strict'\nconst EE = require('events')\nconst Stream = require('stream')\nconst Yallist = require('yallist')\nconst SD = require('string_decoder').StringDecoder\n\nconst EOF = Symbol('EOF')\nconst MAYBE_EMIT_END = Symbol('maybeEmitEnd')\nconst EMITTED_END = Symbol('emittedEnd')\nconst EMITTING_END = Symbol('emittingEnd')\nconst CLOSED = Symbol('closed')\nconst READ = Symbol('read')\nconst FLUSH = Symbol('flush')\nconst FLUSHCHUNK = Symbol('flushChunk')\nconst ENCODING = Symbol('encoding')\nconst DECODER = Symbol('decoder')\nconst FLOWING = Symbol('flowing')\nconst PAUSED = Symbol('paused')\nconst RESUME = Symbol('resume')\nconst BUFFERLENGTH = Symbol('bufferLength')\nconst BUFFERPUSH = Symbol('bufferPush')\nconst BUFFERSHIFT = Symbol('bufferShift')\nconst OBJECTMODE = Symbol('objectMode')\nconst DESTROYED = Symbol('destroyed')\n\n// TODO remove when Node v8 support drops\nconst doIter = global._MP_NO_ITERATOR_SYMBOLS_ !== '1'\nconst ASYNCITERATOR = doIter && Symbol.asyncIterator\n || Symbol('asyncIterator not implemented')\nconst ITERATOR = doIter && Symbol.iterator\n || Symbol('iterator not implemented')\n\n// events that mean 'the stream is over'\n// these are treated specially, and re-emitted\n// if they are listened for after emitting.\nconst isEndish = ev =>\n ev === 'end' ||\n ev === 'finish' ||\n ev === 'prefinish'\n\nconst isArrayBuffer = b => b instanceof ArrayBuffer ||\n typeof b === 'object' &&\n b.constructor &&\n b.constructor.name === 'ArrayBuffer' &&\n b.byteLength >= 0\n\nconst isArrayBufferView = b => !Buffer.isBuffer(b) && ArrayBuffer.isView(b)\n\nmodule.exports = class Minipass extends Stream {\n constructor (options) {\n super()\n this[FLOWING] = false\n // whether we're explicitly paused\n this[PAUSED] = false\n this.pipes = new Yallist()\n this.buffer = new Yallist()\n this[OBJECTMODE] = options && options.objectMode || false\n if (this[OBJECTMODE])\n this[ENCODING] = null\n else\n this[ENCODING] = options && options.encoding || null\n if (this[ENCODING] === 'buffer')\n this[ENCODING] = null\n this[DECODER] = this[ENCODING] ? new SD(this[ENCODING]) : null\n this[EOF] = false\n this[EMITTED_END] = false\n this[EMITTING_END] = false\n this[CLOSED] = false\n this.writable = true\n this.readable = true\n this[BUFFERLENGTH] = 0\n this[DESTROYED] = false\n }\n\n get bufferLength () { return this[BUFFERLENGTH] }\n\n get encoding () { return this[ENCODING] }\n set encoding (enc) {\n if (this[OBJECTMODE])\n throw new Error('cannot set encoding in objectMode')\n\n if (this[ENCODING] && enc !== this[ENCODING] &&\n (this[DECODER] && this[DECODER].lastNeed || this[BUFFERLENGTH]))\n throw new Error('cannot change encoding')\n\n if (this[ENCODING] !== enc) {\n this[DECODER] = enc ? new SD(enc) : null\n if (this.buffer.length)\n this.buffer = this.buffer.map(chunk => this[DECODER].write(chunk))\n }\n\n this[ENCODING] = enc\n }\n\n setEncoding (enc) {\n this.encoding = enc\n }\n\n get objectMode () { return this[OBJECTMODE] }\n set objectMode (om) { this[OBJECTMODE] = this[OBJECTMODE] || !!om }\n\n write (chunk, encoding, cb) {\n if (this[EOF])\n throw new Error('write after end')\n\n if (this[DESTROYED]) {\n this.emit('error', Object.assign(\n new Error('Cannot call write after a stream was destroyed'),\n { code: 'ERR_STREAM_DESTROYED' }\n ))\n return true\n }\n\n if (typeof encoding === 'function')\n cb = encoding, encoding = 'utf8'\n\n if (!encoding)\n encoding = 'utf8'\n\n // convert array buffers and typed array views into buffers\n // at some point in the future, we may want to do the opposite!\n // leave strings and buffers as-is\n // anything else switches us into object mode\n if (!this[OBJECTMODE] && !Buffer.isBuffer(chunk)) {\n if (isArrayBufferView(chunk))\n chunk = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.byteLength)\n else if (isArrayBuffer(chunk))\n chunk = Buffer.from(chunk)\n else if (typeof chunk !== 'string')\n // use the setter so we throw if we have encoding set\n this.objectMode = true\n }\n\n // this ensures at this point that the chunk is a buffer or string\n // don't buffer it up or send it to the decoder\n if (!this.objectMode && !chunk.length) {\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable')\n if (cb)\n cb()\n return this.flowing\n }\n\n // fast-path writing strings of same encoding to a stream with\n // an empty buffer, skipping the buffer/decoder dance\n if (typeof chunk === 'string' && !this[OBJECTMODE] &&\n // unless it is a string already ready for us to use\n !(encoding === this[ENCODING] && !this[DECODER].lastNeed)) {\n chunk = Buffer.from(chunk, encoding)\n }\n\n if (Buffer.isBuffer(chunk) && this[ENCODING])\n chunk = this[DECODER].write(chunk)\n\n if (this.flowing) {\n // if we somehow have something in the buffer, but we think we're\n // flowing, then we need to flush all that out first, or we get\n // chunks coming in out of order. Can't emit 'drain' here though,\n // because we're mid-write, so that'd be bad.\n if (this[BUFFERLENGTH] !== 0)\n this[FLUSH](true)\n this.emit('data', chunk)\n } else\n this[BUFFERPUSH](chunk)\n\n if (this[BUFFERLENGTH] !== 0)\n this.emit('readable')\n\n if (cb)\n cb()\n\n return this.flowing\n }\n\n read (n) {\n if (this[DESTROYED])\n return null\n\n try {\n if (this[BUFFERLENGTH] === 0 || n === 0 || n > this[BUFFERLENGTH])\n return null\n\n if (this[OBJECTMODE])\n n = null\n\n if (this.buffer.length > 1 && !this[OBJECTMODE]) {\n if (this.encoding)\n this.buffer = new Yallist([\n Array.from(this.buffer).join('')\n ])\n else\n this.buffer = new Yallist([\n Buffer.concat(Array.from(this.buffer), this[BUFFERLENGTH])\n ])\n }\n\n return this[READ](n || null, this.buffer.head.value)\n } finally {\n this[MAYBE_EMIT_END]()\n }\n }\n\n [READ] (n, chunk) {\n if (n === chunk.length || n === null)\n this[BUFFERSHIFT]()\n else {\n this.buffer.head.value = chunk.slice(n)\n chunk = chunk.slice(0, n)\n this[BUFFERLENGTH] -= n\n }\n\n this.emit('data', chunk)\n\n if (!this.buffer.length && !this[EOF])\n this.emit('drain')\n\n return chunk\n }\n\n end (chunk, encoding, cb) {\n if (typeof chunk === 'function')\n cb = chunk, chunk = null\n if (typeof encoding === 'function')\n cb = encoding, encoding = 'utf8'\n if (chunk)\n this.write(chunk, encoding)\n if (cb)\n this.once('end', cb)\n this[EOF] = true\n this.writable = false\n\n // if we haven't written anything, then go ahead and emit,\n // even if we're not reading.\n // we'll re-emit if a new 'end' listener is added anyway.\n // This makes MP more suitable to write-only use cases.\n if (this.flowing || !this[PAUSED])\n this[MAYBE_EMIT_END]()\n return this\n }\n\n // don't let the internal resume be overwritten\n [RESUME] () {\n if (this[DESTROYED])\n return\n\n this[PAUSED] = false\n this[FLOWING] = true\n this.emit('resume')\n if (this.buffer.length)\n this[FLUSH]()\n else if (this[EOF])\n this[MAYBE_EMIT_END]()\n else\n this.emit('drain')\n }\n\n resume () {\n return this[RESUME]()\n }\n\n pause () {\n this[FLOWING] = false\n this[PAUSED] = true\n }\n\n get destroyed () {\n return this[DESTROYED]\n }\n\n get flowing () {\n return this[FLOWING]\n }\n\n get paused () {\n return this[PAUSED]\n }\n\n [BUFFERPUSH] (chunk) {\n if (this[OBJECTMODE])\n this[BUFFERLENGTH] += 1\n else\n this[BUFFERLENGTH] += chunk.length\n return this.buffer.push(chunk)\n }\n\n [BUFFERSHIFT] () {\n if (this.buffer.length) {\n if (this[OBJECTMODE])\n this[BUFFERLENGTH] -= 1\n else\n this[BUFFERLENGTH] -= this.buffer.head.value.length\n }\n return this.buffer.shift()\n }\n\n [FLUSH] (noDrain) {\n do {} while (this[FLUSHCHUNK](this[BUFFERSHIFT]()))\n\n if (!noDrain && !this.buffer.length && !this[EOF])\n this.emit('drain')\n }\n\n [FLUSHCHUNK] (chunk) {\n return chunk ? (this.emit('data', chunk), this.flowing) : false\n }\n\n pipe (dest, opts) {\n if (this[DESTROYED])\n return\n\n const ended = this[EMITTED_END]\n opts = opts || {}\n if (dest === process.stdout || dest === process.stderr)\n opts.end = false\n else\n opts.end = opts.end !== false\n\n const p = { dest: dest, opts: opts, ondrain: _ => this[RESUME]() }\n this.pipes.push(p)\n\n dest.on('drain', p.ondrain)\n this[RESUME]()\n // piping an ended stream ends immediately\n if (ended && p.opts.end)\n p.dest.end()\n return dest\n }\n\n addListener (ev, fn) {\n return this.on(ev, fn)\n }\n\n on (ev, fn) {\n try {\n return super.on(ev, fn)\n } finally {\n if (ev === 'data' && !this.pipes.length && !this.flowing)\n this[RESUME]()\n else if (isEndish(ev) && this[EMITTED_END]) {\n super.emit(ev)\n this.removeAllListeners(ev)\n }\n }\n }\n\n get emittedEnd () {\n return this[EMITTED_END]\n }\n\n [MAYBE_EMIT_END] () {\n if (!this[EMITTING_END] &&\n !this[EMITTED_END] &&\n !this[DESTROYED] &&\n this.buffer.length === 0 &&\n this[EOF]) {\n this[EMITTING_END] = true\n this.emit('end')\n this.emit('prefinish')\n this.emit('finish')\n if (this[CLOSED])\n this.emit('close')\n this[EMITTING_END] = false\n }\n }\n\n emit (ev, data) {\n // error and close are only events allowed after calling destroy()\n if (ev !== 'error' && ev !== 'close' && ev !== DESTROYED && this[DESTROYED])\n return\n else if (ev === 'data') {\n if (!data)\n return\n\n if (this.pipes.length)\n this.pipes.forEach(p =>\n p.dest.write(data) === false && this.pause())\n } else if (ev === 'end') {\n // only actual end gets this treatment\n if (this[EMITTED_END] === true)\n return\n\n this[EMITTED_END] = true\n this.readable = false\n\n if (this[DECODER]) {\n data = this[DECODER].end()\n if (data) {\n this.pipes.forEach(p => p.dest.write(data))\n super.emit('data', data)\n }\n }\n\n this.pipes.forEach(p => {\n p.dest.removeListener('drain', p.ondrain)\n if (p.opts.end)\n p.dest.end()\n })\n } else if (ev === 'close') {\n this[CLOSED] = true\n // don't emit close before 'end' and 'finish'\n if (!this[EMITTED_END] && !this[DESTROYED])\n return\n }\n\n // TODO: replace with a spread operator when Node v4 support drops\n const args = new Array(arguments.length)\n args[0] = ev\n args[1] = data\n if (arguments.length > 2) {\n for (let i = 2; i < arguments.length; i++) {\n args[i] = arguments[i]\n }\n }\n\n try {\n return super.emit.apply(this, args)\n } finally {\n if (!isEndish(ev))\n this[MAYBE_EMIT_END]()\n else\n this.removeAllListeners(ev)\n }\n }\n\n // const all = await stream.collect()\n collect () {\n const buf = []\n if (!this[OBJECTMODE])\n buf.dataLength = 0\n // set the promise first, in case an error is raised\n // by triggering the flow here.\n const p = this.promise()\n this.on('data', c => {\n buf.push(c)\n if (!this[OBJECTMODE])\n buf.dataLength += c.length\n })\n return p.then(() => buf)\n }\n\n // const data = await stream.concat()\n concat () {\n return this[OBJECTMODE]\n ? Promise.reject(new Error('cannot concat in objectMode'))\n : this.collect().then(buf =>\n this[OBJECTMODE]\n ? Promise.reject(new Error('cannot concat in objectMode'))\n : this[ENCODING] ? buf.join('') : Buffer.concat(buf, buf.dataLength))\n }\n\n // stream.promise().then(() => done, er => emitted error)\n promise () {\n return new Promise((resolve, reject) => {\n this.on(DESTROYED, () => reject(new Error('stream destroyed')))\n this.on('end', () => resolve())\n this.on('error', er => reject(er))\n })\n }\n\n // for await (let chunk of stream)\n [ASYNCITERATOR] () {\n const next = () => {\n const res = this.read()\n if (res !== null)\n return Promise.resolve({ done: false, value: res })\n\n if (this[EOF])\n return Promise.resolve({ done: true })\n\n let resolve = null\n let reject = null\n const onerr = er => {\n this.removeListener('data', ondata)\n this.removeListener('end', onend)\n reject(er)\n }\n const ondata = value => {\n this.removeListener('error', onerr)\n this.removeListener('end', onend)\n this.pause()\n resolve({ value: value, done: !!this[EOF] })\n }\n const onend = () => {\n this.removeListener('error', onerr)\n this.removeListener('data', ondata)\n resolve({ done: true })\n }\n const ondestroy = () => onerr(new Error('stream destroyed'))\n return new Promise((res, rej) => {\n reject = rej\n resolve = res\n this.once(DESTROYED, ondestroy)\n this.once('error', onerr)\n this.once('end', onend)\n this.once('data', ondata)\n })\n }\n\n return { next }\n }\n\n // for (let chunk of stream)\n [ITERATOR] () {\n const next = () => {\n const value = this.read()\n const done = value === null\n return { value, done }\n }\n return { next }\n }\n\n destroy (er) {\n if (this[DESTROYED]) {\n if (er)\n this.emit('error', er)\n else\n this.emit(DESTROYED)\n return this\n }\n\n this[DESTROYED] = true\n\n // throw away all buffered data, it's never coming out\n this.buffer = new Yallist()\n this[BUFFERLENGTH] = 0\n\n if (typeof this.close === 'function' && !this[CLOSED])\n this.close()\n\n if (er)\n this.emit('error', er)\n else // if no error to emit, still reject pending promises\n this.emit(DESTROYED)\n\n return this\n }\n\n static isStream (s) {\n return !!s && (s instanceof Minipass || s instanceof Stream ||\n s instanceof EE && (\n typeof s.pipe === 'function' || // readable\n (typeof s.write === 'function' && typeof s.end === 'function') // writable\n ))\n }\n}\n","// Update with any zlib constants that are added or changed in the future.\n// Node v6 didn't export this, so we just hard code the version and rely\n// on all the other hard-coded values from zlib v4736. When node v6\n// support drops, we can just export the realZlibConstants object.\nconst realZlibConstants = require('zlib').constants ||\n /* istanbul ignore next */ { ZLIB_VERNUM: 4736 }\n\nmodule.exports = Object.freeze(Object.assign(Object.create(null), {\n Z_NO_FLUSH: 0,\n Z_PARTIAL_FLUSH: 1,\n Z_SYNC_FLUSH: 2,\n Z_FULL_FLUSH: 3,\n Z_FINISH: 4,\n Z_BLOCK: 5,\n Z_OK: 0,\n Z_STREAM_END: 1,\n Z_NEED_DICT: 2,\n Z_ERRNO: -1,\n Z_STREAM_ERROR: -2,\n Z_DATA_ERROR: -3,\n Z_MEM_ERROR: -4,\n Z_BUF_ERROR: -5,\n Z_VERSION_ERROR: -6,\n Z_NO_COMPRESSION: 0,\n Z_BEST_SPEED: 1,\n Z_BEST_COMPRESSION: 9,\n Z_DEFAULT_COMPRESSION: -1,\n Z_FILTERED: 1,\n Z_HUFFMAN_ONLY: 2,\n Z_RLE: 3,\n Z_FIXED: 4,\n Z_DEFAULT_STRATEGY: 0,\n DEFLATE: 1,\n INFLATE: 2,\n GZIP: 3,\n GUNZIP: 4,\n DEFLATERAW: 5,\n INFLATERAW: 6,\n UNZIP: 7,\n BROTLI_DECODE: 8,\n BROTLI_ENCODE: 9,\n Z_MIN_WINDOWBITS: 8,\n Z_MAX_WINDOWBITS: 15,\n Z_DEFAULT_WINDOWBITS: 15,\n Z_MIN_CHUNK: 64,\n Z_MAX_CHUNK: Infinity,\n Z_DEFAULT_CHUNK: 16384,\n Z_MIN_MEMLEVEL: 1,\n Z_MAX_MEMLEVEL: 9,\n Z_DEFAULT_MEMLEVEL: 8,\n Z_MIN_LEVEL: -1,\n Z_MAX_LEVEL: 9,\n Z_DEFAULT_LEVEL: -1,\n BROTLI_OPERATION_PROCESS: 0,\n BROTLI_OPERATION_FLUSH: 1,\n BROTLI_OPERATION_FINISH: 2,\n BROTLI_OPERATION_EMIT_METADATA: 3,\n BROTLI_MODE_GENERIC: 0,\n BROTLI_MODE_TEXT: 1,\n BROTLI_MODE_FONT: 2,\n BROTLI_DEFAULT_MODE: 0,\n BROTLI_MIN_QUALITY: 0,\n BROTLI_MAX_QUALITY: 11,\n BROTLI_DEFAULT_QUALITY: 11,\n BROTLI_MIN_WINDOW_BITS: 10,\n BROTLI_MAX_WINDOW_BITS: 24,\n BROTLI_LARGE_MAX_WINDOW_BITS: 30,\n BROTLI_DEFAULT_WINDOW: 22,\n BROTLI_MIN_INPUT_BLOCK_BITS: 16,\n BROTLI_MAX_INPUT_BLOCK_BITS: 24,\n BROTLI_PARAM_MODE: 0,\n BROTLI_PARAM_QUALITY: 1,\n BROTLI_PARAM_LGWIN: 2,\n BROTLI_PARAM_LGBLOCK: 3,\n BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4,\n BROTLI_PARAM_SIZE_HINT: 5,\n BROTLI_PARAM_LARGE_WINDOW: 6,\n BROTLI_PARAM_NPOSTFIX: 7,\n BROTLI_PARAM_NDIRECT: 8,\n BROTLI_DECODER_RESULT_ERROR: 0,\n BROTLI_DECODER_RESULT_SUCCESS: 1,\n BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2,\n BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3,\n BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0,\n BROTLI_DECODER_PARAM_LARGE_WINDOW: 1,\n BROTLI_DECODER_NO_ERROR: 0,\n BROTLI_DECODER_SUCCESS: 1,\n BROTLI_DECODER_NEEDS_MORE_INPUT: 2,\n BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3,\n BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1,\n BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2,\n BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3,\n BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4,\n BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5,\n BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6,\n BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7,\n BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8,\n BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9,\n BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10,\n BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11,\n BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12,\n BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13,\n BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14,\n BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15,\n BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16,\n BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19,\n BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20,\n BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21,\n BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22,\n BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25,\n BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26,\n BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27,\n BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30,\n BROTLI_DECODER_ERROR_UNREACHABLE: -31,\n}, realZlibConstants))\n","'use strict'\n\nconst assert = require('assert')\nconst Buffer = require('buffer').Buffer\nconst realZlib = require('zlib')\n\nconst constants = exports.constants = require('./constants.js')\nconst Minipass = require('minipass')\n\nconst OriginalBufferConcat = Buffer.concat\n\nconst _superWrite = Symbol('_superWrite')\nclass ZlibError extends Error {\n constructor (err) {\n super('zlib: ' + err.message)\n this.code = err.code\n this.errno = err.errno\n /* istanbul ignore if */\n if (!this.code)\n this.code = 'ZLIB_ERROR'\n\n this.message = 'zlib: ' + err.message\n Error.captureStackTrace(this, this.constructor)\n }\n\n get name () {\n return 'ZlibError'\n }\n}\n\n// the Zlib class they all inherit from\n// This thing manages the queue of requests, and returns\n// true or false if there is anything in the queue when\n// you call the .write() method.\nconst _opts = Symbol('opts')\nconst _flushFlag = Symbol('flushFlag')\nconst _finishFlushFlag = Symbol('finishFlushFlag')\nconst _fullFlushFlag = Symbol('fullFlushFlag')\nconst _handle = Symbol('handle')\nconst _onError = Symbol('onError')\nconst _sawError = Symbol('sawError')\nconst _level = Symbol('level')\nconst _strategy = Symbol('strategy')\nconst _ended = Symbol('ended')\nconst _defaultFullFlush = Symbol('_defaultFullFlush')\n\nclass ZlibBase extends Minipass {\n constructor (opts, mode) {\n if (!opts || typeof opts !== 'object')\n throw new TypeError('invalid options for ZlibBase constructor')\n\n super(opts)\n this[_sawError] = false\n this[_ended] = false\n this[_opts] = opts\n\n this[_flushFlag] = opts.flush\n this[_finishFlushFlag] = opts.finishFlush\n // this will throw if any options are invalid for the class selected\n try {\n this[_handle] = new realZlib[mode](opts)\n } catch (er) {\n // make sure that all errors get decorated properly\n throw new ZlibError(er)\n }\n\n this[_onError] = (err) => {\n // no sense raising multiple errors, since we abort on the first one.\n if (this[_sawError])\n return\n\n this[_sawError] = true\n\n // there is no way to cleanly recover.\n // continuing only obscures problems.\n this.close()\n this.emit('error', err)\n }\n\n this[_handle].on('error', er => this[_onError](new ZlibError(er)))\n this.once('end', () => this.close)\n }\n\n close () {\n if (this[_handle]) {\n this[_handle].close()\n this[_handle] = null\n this.emit('close')\n }\n }\n\n reset () {\n if (!this[_sawError]) {\n assert(this[_handle], 'zlib binding closed')\n return this[_handle].reset()\n }\n }\n\n flush (flushFlag) {\n if (this.ended)\n return\n\n if (typeof flushFlag !== 'number')\n flushFlag = this[_fullFlushFlag]\n this.write(Object.assign(Buffer.alloc(0), { [_flushFlag]: flushFlag }))\n }\n\n end (chunk, encoding, cb) {\n if (chunk)\n this.write(chunk, encoding)\n this.flush(this[_finishFlushFlag])\n this[_ended] = true\n return super.end(null, null, cb)\n }\n\n get ended () {\n return this[_ended]\n }\n\n write (chunk, encoding, cb) {\n // process the chunk using the sync process\n // then super.write() all the outputted chunks\n if (typeof encoding === 'function')\n cb = encoding, encoding = 'utf8'\n\n if (typeof chunk === 'string')\n chunk = Buffer.from(chunk, encoding)\n\n if (this[_sawError])\n return\n assert(this[_handle], 'zlib binding closed')\n\n // _processChunk tries to .close() the native handle after it's done, so we\n // intercept that by temporarily making it a no-op.\n const nativeHandle = this[_handle]._handle\n const originalNativeClose = nativeHandle.close\n nativeHandle.close = () => {}\n const originalClose = this[_handle].close\n this[_handle].close = () => {}\n // It also calls `Buffer.concat()` at the end, which may be convenient\n // for some, but which we are not interested in as it slows us down.\n Buffer.concat = (args) => args\n let result\n try {\n const flushFlag = typeof chunk[_flushFlag] === 'number'\n ? chunk[_flushFlag] : this[_flushFlag]\n result = this[_handle]._processChunk(chunk, flushFlag)\n // if we don't throw, reset it back how it was\n Buffer.concat = OriginalBufferConcat\n } catch (err) {\n // or if we do, put Buffer.concat() back before we emit error\n // Error events call into user code, which may call Buffer.concat()\n Buffer.concat = OriginalBufferConcat\n this[_onError](new ZlibError(err))\n } finally {\n if (this[_handle]) {\n // Core zlib resets `_handle` to null after attempting to close the\n // native handle. Our no-op handler prevented actual closure, but we\n // need to restore the `._handle` property.\n this[_handle]._handle = nativeHandle\n nativeHandle.close = originalNativeClose\n this[_handle].close = originalClose\n // `_processChunk()` adds an 'error' listener. If we don't remove it\n // after each call, these handlers start piling up.\n this[_handle].removeAllListeners('error')\n // make sure OUR error listener is still attached tho\n }\n }\n\n if (this[_handle])\n this[_handle].on('error', er => this[_onError](new ZlibError(er)))\n\n let writeReturn\n if (result) {\n if (Array.isArray(result) && result.length > 0) {\n // The first buffer is always `handle._outBuffer`, which would be\n // re-used for later invocations; so, we always have to copy that one.\n writeReturn = this[_superWrite](Buffer.from(result[0]))\n for (let i = 1; i < result.length; i++) {\n writeReturn = this[_superWrite](result[i])\n }\n } else {\n writeReturn = this[_superWrite](Buffer.from(result))\n }\n }\n\n if (cb)\n cb()\n return writeReturn\n }\n\n [_superWrite] (data) {\n return super.write(data)\n }\n}\n\nclass Zlib extends ZlibBase {\n constructor (opts, mode) {\n opts = opts || {}\n\n opts.flush = opts.flush || constants.Z_NO_FLUSH\n opts.finishFlush = opts.finishFlush || constants.Z_FINISH\n super(opts, mode)\n\n this[_fullFlushFlag] = constants.Z_FULL_FLUSH\n this[_level] = opts.level\n this[_strategy] = opts.strategy\n }\n\n params (level, strategy) {\n if (this[_sawError])\n return\n\n if (!this[_handle])\n throw new Error('cannot switch params when binding is closed')\n\n // no way to test this without also not supporting params at all\n /* istanbul ignore if */\n if (!this[_handle].params)\n throw new Error('not supported in this implementation')\n\n if (this[_level] !== level || this[_strategy] !== strategy) {\n this.flush(constants.Z_SYNC_FLUSH)\n assert(this[_handle], 'zlib binding closed')\n // .params() calls .flush(), but the latter is always async in the\n // core zlib. We override .flush() temporarily to intercept that and\n // flush synchronously.\n const origFlush = this[_handle].flush\n this[_handle].flush = (flushFlag, cb) => {\n this.flush(flushFlag)\n cb()\n }\n try {\n this[_handle].params(level, strategy)\n } finally {\n this[_handle].flush = origFlush\n }\n /* istanbul ignore else */\n if (this[_handle]) {\n this[_level] = level\n this[_strategy] = strategy\n }\n }\n }\n}\n\n// minimal 2-byte header\nclass Deflate extends Zlib {\n constructor (opts) {\n super(opts, 'Deflate')\n }\n}\n\nclass Inflate extends Zlib {\n constructor (opts) {\n super(opts, 'Inflate')\n }\n}\n\n// gzip - bigger header, same deflate compression\nconst _portable = Symbol('_portable')\nclass Gzip extends Zlib {\n constructor (opts) {\n super(opts, 'Gzip')\n this[_portable] = opts && !!opts.portable\n }\n\n [_superWrite] (data) {\n if (!this[_portable])\n return super[_superWrite](data)\n\n // we'll always get the header emitted in one first chunk\n // overwrite the OS indicator byte with 0xFF\n this[_portable] = false\n data[9] = 255\n return super[_superWrite](data)\n }\n}\n\nclass Gunzip extends Zlib {\n constructor (opts) {\n super(opts, 'Gunzip')\n }\n}\n\n// raw - no header\nclass DeflateRaw extends Zlib {\n constructor (opts) {\n super(opts, 'DeflateRaw')\n }\n}\n\nclass InflateRaw extends Zlib {\n constructor (opts) {\n super(opts, 'InflateRaw')\n }\n}\n\n// auto-detect header.\nclass Unzip extends Zlib {\n constructor (opts) {\n super(opts, 'Unzip')\n }\n}\n\nclass Brotli extends ZlibBase {\n constructor (opts, mode) {\n opts = opts || {}\n\n opts.flush = opts.flush || constants.BROTLI_OPERATION_PROCESS\n opts.finishFlush = opts.finishFlush || constants.BROTLI_OPERATION_FINISH\n\n super(opts, mode)\n\n this[_fullFlushFlag] = constants.BROTLI_OPERATION_FLUSH\n }\n}\n\nclass BrotliCompress extends Brotli {\n constructor (opts) {\n super(opts, 'BrotliCompress')\n }\n}\n\nclass BrotliDecompress extends Brotli {\n constructor (opts) {\n super(opts, 'BrotliDecompress')\n }\n}\n\nexports.Deflate = Deflate\nexports.Inflate = Inflate\nexports.Gzip = Gzip\nexports.Gunzip = Gunzip\nexports.DeflateRaw = DeflateRaw\nexports.InflateRaw = InflateRaw\nexports.Unzip = Unzip\n/* istanbul ignore else */\nif (typeof realZlib.BrotliCompress === 'function') {\n exports.BrotliCompress = BrotliCompress\n exports.BrotliDecompress = BrotliDecompress\n} else {\n exports.BrotliCompress = exports.BrotliDecompress = class {\n constructor () {\n throw new Error('Brotli is not supported in this version of Node.js')\n }\n }\n}\n","const optsArg = require('./lib/opts-arg.js')\nconst pathArg = require('./lib/path-arg.js')\n\nconst {mkdirpNative, mkdirpNativeSync} = require('./lib/mkdirp-native.js')\nconst {mkdirpManual, mkdirpManualSync} = require('./lib/mkdirp-manual.js')\nconst {useNative, useNativeSync} = require('./lib/use-native.js')\n\n\nconst mkdirp = (path, opts) => {\n path = pathArg(path)\n opts = optsArg(opts)\n return useNative(opts)\n ? mkdirpNative(path, opts)\n : mkdirpManual(path, opts)\n}\n\nconst mkdirpSync = (path, opts) => {\n path = pathArg(path)\n opts = optsArg(opts)\n return useNativeSync(opts)\n ? mkdirpNativeSync(path, opts)\n : mkdirpManualSync(path, opts)\n}\n\nmkdirp.sync = mkdirpSync\nmkdirp.native = (path, opts) => mkdirpNative(pathArg(path), optsArg(opts))\nmkdirp.manual = (path, opts) => mkdirpManual(pathArg(path), optsArg(opts))\nmkdirp.nativeSync = (path, opts) => mkdirpNativeSync(pathArg(path), optsArg(opts))\nmkdirp.manualSync = (path, opts) => mkdirpManualSync(pathArg(path), optsArg(opts))\n\nmodule.exports = mkdirp\n","const {dirname} = require('path')\n\nconst findMade = (opts, parent, path = undefined) => {\n // we never want the 'made' return value to be a root directory\n if (path === parent)\n return Promise.resolve()\n\n return opts.statAsync(parent).then(\n st => st.isDirectory() ? path : undefined, // will fail later\n er => er.code === 'ENOENT'\n ? findMade(opts, dirname(parent), parent)\n : undefined\n )\n}\n\nconst findMadeSync = (opts, parent, path = undefined) => {\n if (path === parent)\n return undefined\n\n try {\n return opts.statSync(parent).isDirectory() ? path : undefined\n } catch (er) {\n return er.code === 'ENOENT'\n ? findMadeSync(opts, dirname(parent), parent)\n : undefined\n }\n}\n\nmodule.exports = {findMade, findMadeSync}\n","const {dirname} = require('path')\n\nconst mkdirpManual = (path, opts, made) => {\n opts.recursive = false\n const parent = dirname(path)\n if (parent === path) {\n return opts.mkdirAsync(path, opts).catch(er => {\n // swallowed by recursive implementation on posix systems\n // any other error is a failure\n if (er.code !== 'EISDIR')\n throw er\n })\n }\n\n return opts.mkdirAsync(path, opts).then(() => made || path, er => {\n if (er.code === 'ENOENT')\n return mkdirpManual(parent, opts)\n .then(made => mkdirpManual(path, opts, made))\n if (er.code !== 'EEXIST' && er.code !== 'EROFS')\n throw er\n return opts.statAsync(path).then(st => {\n if (st.isDirectory())\n return made\n else\n throw er\n }, () => { throw er })\n })\n}\n\nconst mkdirpManualSync = (path, opts, made) => {\n const parent = dirname(path)\n opts.recursive = false\n\n if (parent === path) {\n try {\n return opts.mkdirSync(path, opts)\n } catch (er) {\n // swallowed by recursive implementation on posix systems\n // any other error is a failure\n if (er.code !== 'EISDIR')\n throw er\n else\n return\n }\n }\n\n try {\n opts.mkdirSync(path, opts)\n return made || path\n } catch (er) {\n if (er.code === 'ENOENT')\n return mkdirpManualSync(path, opts, mkdirpManualSync(parent, opts, made))\n if (er.code !== 'EEXIST' && er.code !== 'EROFS')\n throw er\n try {\n if (!opts.statSync(path).isDirectory())\n throw er\n } catch (_) {\n throw er\n }\n }\n}\n\nmodule.exports = {mkdirpManual, mkdirpManualSync}\n","const {dirname} = require('path')\nconst {findMade, findMadeSync} = require('./find-made.js')\nconst {mkdirpManual, mkdirpManualSync} = require('./mkdirp-manual.js')\n\nconst mkdirpNative = (path, opts) => {\n opts.recursive = true\n const parent = dirname(path)\n if (parent === path)\n return opts.mkdirAsync(path, opts)\n\n return findMade(opts, path).then(made =>\n opts.mkdirAsync(path, opts).then(() => made)\n .catch(er => {\n if (er.code === 'ENOENT')\n return mkdirpManual(path, opts)\n else\n throw er\n }))\n}\n\nconst mkdirpNativeSync = (path, opts) => {\n opts.recursive = true\n const parent = dirname(path)\n if (parent === path)\n return opts.mkdirSync(path, opts)\n\n const made = findMadeSync(opts, path)\n try {\n opts.mkdirSync(path, opts)\n return made\n } catch (er) {\n if (er.code === 'ENOENT')\n return mkdirpManualSync(path, opts)\n else\n throw er\n }\n}\n\nmodule.exports = {mkdirpNative, mkdirpNativeSync}\n","const { promisify } = require('util')\nconst fs = require('fs')\nconst optsArg = opts => {\n if (!opts)\n opts = { mode: 0o777, fs }\n else if (typeof opts === 'object')\n opts = { mode: 0o777, fs, ...opts }\n else if (typeof opts === 'number')\n opts = { mode: opts, fs }\n else if (typeof opts === 'string')\n opts = { mode: parseInt(opts, 8), fs }\n else\n throw new TypeError('invalid options argument')\n\n opts.mkdir = opts.mkdir || opts.fs.mkdir || fs.mkdir\n opts.mkdirAsync = promisify(opts.mkdir)\n opts.stat = opts.stat || opts.fs.stat || fs.stat\n opts.statAsync = promisify(opts.stat)\n opts.statSync = opts.statSync || opts.fs.statSync || fs.statSync\n opts.mkdirSync = opts.mkdirSync || opts.fs.mkdirSync || fs.mkdirSync\n return opts\n}\nmodule.exports = optsArg\n","const platform = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform\nconst { resolve, parse } = require('path')\nconst pathArg = path => {\n if (/\\0/.test(path)) {\n // simulate same failure that node raises\n throw Object.assign(\n new TypeError('path must be a string without null bytes'),\n {\n path,\n code: 'ERR_INVALID_ARG_VALUE',\n }\n )\n }\n\n path = resolve(path)\n if (platform === 'win32') {\n const badWinChars = /[*|\"<>?:]/\n const {root} = parse(path)\n if (badWinChars.test(path.substr(root.length))) {\n throw Object.assign(new Error('Illegal characters in path.'), {\n path,\n code: 'EINVAL',\n })\n }\n }\n\n return path\n}\nmodule.exports = pathArg\n","const fs = require('fs')\n\nconst version = process.env.__TESTING_MKDIRP_NODE_VERSION__ || process.version\nconst versArr = version.replace(/^v/, '').split('.')\nconst hasNative = +versArr[0] > 10 || +versArr[0] === 10 && +versArr[1] >= 12\n\nconst useNative = !hasNative ? () => false : opts => opts.mkdir === fs.mkdir\nconst useNativeSync = !hasNative ? () => false : opts => opts.mkdirSync === fs.mkdirSync\n\nmodule.exports = {useNative, useNativeSync}\n","'use strict'\n\n// high-level commands\nexports.c = exports.create = require('./lib/create.js')\nexports.r = exports.replace = require('./lib/replace.js')\nexports.t = exports.list = require('./lib/list.js')\nexports.u = exports.update = require('./lib/update.js')\nexports.x = exports.extract = require('./lib/extract.js')\n\n// classes\nexports.Pack = require('./lib/pack.js')\nexports.Unpack = require('./lib/unpack.js')\nexports.Parse = require('./lib/parse.js')\nexports.ReadEntry = require('./lib/read-entry.js')\nexports.WriteEntry = require('./lib/write-entry.js')\nexports.Header = require('./lib/header.js')\nexports.Pax = require('./lib/pax.js')\nexports.types = require('./lib/types.js')\n","'use strict'\n\n// tar -c\nconst hlo = require('./high-level-opt.js')\n\nconst Pack = require('./pack.js')\nconst fsm = require('fs-minipass')\nconst t = require('./list.js')\nconst path = require('path')\n\nmodule.exports = (opt_, files, cb) => {\n if (typeof files === 'function')\n cb = files\n\n if (Array.isArray(opt_))\n files = opt_, opt_ = {}\n\n if (!files || !Array.isArray(files) || !files.length)\n throw new TypeError('no files or directories specified')\n\n files = Array.from(files)\n\n const opt = hlo(opt_)\n\n if (opt.sync && typeof cb === 'function')\n throw new TypeError('callback not supported for sync tar functions')\n\n if (!opt.file && typeof cb === 'function')\n throw new TypeError('callback only supported with file option')\n\n return opt.file && opt.sync ? createFileSync(opt, files)\n : opt.file ? createFile(opt, files, cb)\n : opt.sync ? createSync(opt, files)\n : create(opt, files)\n}\n\nconst createFileSync = (opt, files) => {\n const p = new Pack.Sync(opt)\n const stream = new fsm.WriteStreamSync(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream)\n addFilesSync(p, files)\n}\n\nconst createFile = (opt, files, cb) => {\n const p = new Pack(opt)\n const stream = new fsm.WriteStream(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream)\n\n const promise = new Promise((res, rej) => {\n stream.on('error', rej)\n stream.on('close', res)\n p.on('error', rej)\n })\n\n addFilesAsync(p, files)\n\n return cb ? promise.then(cb, cb) : promise\n}\n\nconst addFilesSync = (p, files) => {\n files.forEach(file => {\n if (file.charAt(0) === '@') {\n t({\n file: path.resolve(p.cwd, file.substr(1)),\n sync: true,\n noResume: true,\n onentry: entry => p.add(entry),\n })\n } else\n p.add(file)\n })\n p.end()\n}\n\nconst addFilesAsync = (p, files) => {\n while (files.length) {\n const file = files.shift()\n if (file.charAt(0) === '@') {\n return t({\n file: path.resolve(p.cwd, file.substr(1)),\n noResume: true,\n onentry: entry => p.add(entry),\n }).then(_ => addFilesAsync(p, files))\n } else\n p.add(file)\n }\n p.end()\n}\n\nconst createSync = (opt, files) => {\n const p = new Pack.Sync(opt)\n addFilesSync(p, files)\n return p\n}\n\nconst create = (opt, files) => {\n const p = new Pack(opt)\n addFilesAsync(p, files)\n return p\n}\n","'use strict'\n\n// tar -x\nconst hlo = require('./high-level-opt.js')\nconst Unpack = require('./unpack.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst path = require('path')\n\nmodule.exports = (opt_, files, cb) => {\n if (typeof opt_ === 'function')\n cb = opt_, files = null, opt_ = {}\n else if (Array.isArray(opt_))\n files = opt_, opt_ = {}\n\n if (typeof files === 'function')\n cb = files, files = null\n\n if (!files)\n files = []\n else\n files = Array.from(files)\n\n const opt = hlo(opt_)\n\n if (opt.sync && typeof cb === 'function')\n throw new TypeError('callback not supported for sync tar functions')\n\n if (!opt.file && typeof cb === 'function')\n throw new TypeError('callback only supported with file option')\n\n if (files.length)\n filesFilter(opt, files)\n\n return opt.file && opt.sync ? extractFileSync(opt)\n : opt.file ? extractFile(opt, cb)\n : opt.sync ? extractSync(opt)\n : extract(opt)\n}\n\n// construct a filter that limits the file entries listed\n// include child entries if a dir is included\nconst filesFilter = (opt, files) => {\n const map = new Map(files.map(f => [f.replace(/\\/+$/, ''), true]))\n const filter = opt.filter\n\n const mapHas = (file, r) => {\n const root = r || path.parse(file).root || '.'\n const ret = file === root ? false\n : map.has(file) ? map.get(file)\n : mapHas(path.dirname(file), root)\n\n map.set(file, ret)\n return ret\n }\n\n opt.filter = filter\n ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\\/+$/, ''))\n : file => mapHas(file.replace(/\\/+$/, ''))\n}\n\nconst extractFileSync = opt => {\n const u = new Unpack.Sync(opt)\n\n const file = opt.file\n const stat = fs.statSync(file)\n // This trades a zero-byte read() syscall for a stat\n // However, it will usually result in less memory allocation\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n const stream = new fsm.ReadStreamSync(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.pipe(u)\n}\n\nconst extractFile = (opt, cb) => {\n const u = new Unpack(opt)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n\n const file = opt.file\n const p = new Promise((resolve, reject) => {\n u.on('error', reject)\n u.on('close', resolve)\n\n // This trades a zero-byte read() syscall for a stat\n // However, it will usually result in less memory allocation\n fs.stat(file, (er, stat) => {\n if (er)\n reject(er)\n else {\n const stream = new fsm.ReadStream(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.on('error', reject)\n stream.pipe(u)\n }\n })\n })\n return cb ? p.then(cb, cb) : p\n}\n\nconst extractSync = opt => new Unpack.Sync(opt)\n\nconst extract = opt => new Unpack(opt)\n","// Get the appropriate flag to use for creating files\n// We use fmap on Windows platforms for files less than\n// 512kb. This is a fairly low limit, but avoids making\n// things slower in some cases. Since most of what this\n// library is used for is extracting tarballs of many\n// relatively small files in npm packages and the like,\n// it can be a big boost on Windows platforms.\n// Only supported in Node v12.9.0 and above.\nconst platform = process.env.__FAKE_PLATFORM__ || process.platform\nconst isWindows = platform === 'win32'\nconst fs = global.__FAKE_TESTING_FS__ || require('fs')\n\n/* istanbul ignore next */\nconst { O_CREAT, O_TRUNC, O_WRONLY, UV_FS_O_FILEMAP = 0 } = fs.constants\n\nconst fMapEnabled = isWindows && !!UV_FS_O_FILEMAP\nconst fMapLimit = 512 * 1024\nconst fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY\nmodule.exports = !fMapEnabled ? () => 'w'\n : size => size < fMapLimit ? fMapFlag : 'w'\n","'use strict'\n// parse a 512-byte header block to a data object, or vice-versa\n// encode returns `true` if a pax extended header is needed, because\n// the data could not be faithfully encoded in a simple header.\n// (Also, check header.needPax to see if it needs a pax header.)\n\nconst types = require('./types.js')\nconst pathModule = require('path').posix\nconst large = require('./large-numbers.js')\n\nconst SLURP = Symbol('slurp')\nconst TYPE = Symbol('type')\n\nclass Header {\n constructor (data, off, ex, gex) {\n this.cksumValid = false\n this.needPax = false\n this.nullBlock = false\n\n this.block = null\n this.path = null\n this.mode = null\n this.uid = null\n this.gid = null\n this.size = null\n this.mtime = null\n this.cksum = null\n this[TYPE] = '0'\n this.linkpath = null\n this.uname = null\n this.gname = null\n this.devmaj = 0\n this.devmin = 0\n this.atime = null\n this.ctime = null\n\n if (Buffer.isBuffer(data))\n this.decode(data, off || 0, ex, gex)\n else if (data)\n this.set(data)\n }\n\n decode (buf, off, ex, gex) {\n if (!off)\n off = 0\n\n if (!buf || !(buf.length >= off + 512))\n throw new Error('need 512 bytes for header')\n\n this.path = decString(buf, off, 100)\n this.mode = decNumber(buf, off + 100, 8)\n this.uid = decNumber(buf, off + 108, 8)\n this.gid = decNumber(buf, off + 116, 8)\n this.size = decNumber(buf, off + 124, 12)\n this.mtime = decDate(buf, off + 136, 12)\n this.cksum = decNumber(buf, off + 148, 12)\n\n // if we have extended or global extended headers, apply them now\n // See https://github.com/npm/node-tar/pull/187\n this[SLURP](ex)\n this[SLURP](gex, true)\n\n // old tar versions marked dirs as a file with a trailing /\n this[TYPE] = decString(buf, off + 156, 1)\n if (this[TYPE] === '')\n this[TYPE] = '0'\n if (this[TYPE] === '0' && this.path.substr(-1) === '/')\n this[TYPE] = '5'\n\n // tar implementations sometimes incorrectly put the stat(dir).size\n // as the size in the tarball, even though Directory entries are\n // not able to have any body at all. In the very rare chance that\n // it actually DOES have a body, we weren't going to do anything with\n // it anyway, and it'll just be a warning about an invalid header.\n if (this[TYPE] === '5')\n this.size = 0\n\n this.linkpath = decString(buf, off + 157, 100)\n if (buf.slice(off + 257, off + 265).toString() === 'ustar\\u000000') {\n this.uname = decString(buf, off + 265, 32)\n this.gname = decString(buf, off + 297, 32)\n this.devmaj = decNumber(buf, off + 329, 8)\n this.devmin = decNumber(buf, off + 337, 8)\n if (buf[off + 475] !== 0) {\n // definitely a prefix, definitely >130 chars.\n const prefix = decString(buf, off + 345, 155)\n this.path = prefix + '/' + this.path\n } else {\n const prefix = decString(buf, off + 345, 130)\n if (prefix)\n this.path = prefix + '/' + this.path\n this.atime = decDate(buf, off + 476, 12)\n this.ctime = decDate(buf, off + 488, 12)\n }\n }\n\n let sum = 8 * 0x20\n for (let i = off; i < off + 148; i++)\n sum += buf[i]\n\n for (let i = off + 156; i < off + 512; i++)\n sum += buf[i]\n\n this.cksumValid = sum === this.cksum\n if (this.cksum === null && sum === 8 * 0x20)\n this.nullBlock = true\n }\n\n [SLURP] (ex, global) {\n for (const k in ex) {\n // we slurp in everything except for the path attribute in\n // a global extended header, because that's weird.\n if (ex[k] !== null && ex[k] !== undefined &&\n !(global && k === 'path'))\n this[k] = ex[k]\n }\n }\n\n encode (buf, off) {\n if (!buf) {\n buf = this.block = Buffer.alloc(512)\n off = 0\n }\n\n if (!off)\n off = 0\n\n if (!(buf.length >= off + 512))\n throw new Error('need 512 bytes for header')\n\n const prefixSize = this.ctime || this.atime ? 130 : 155\n const split = splitPrefix(this.path || '', prefixSize)\n const path = split[0]\n const prefix = split[1]\n this.needPax = split[2]\n\n this.needPax = encString(buf, off, 100, path) || this.needPax\n this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax\n this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax\n this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax\n this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax\n this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax\n buf[off + 156] = this[TYPE].charCodeAt(0)\n this.needPax = encString(buf, off + 157, 100, this.linkpath) || this.needPax\n buf.write('ustar\\u000000', off + 257, 8)\n this.needPax = encString(buf, off + 265, 32, this.uname) || this.needPax\n this.needPax = encString(buf, off + 297, 32, this.gname) || this.needPax\n this.needPax = encNumber(buf, off + 329, 8, this.devmaj) || this.needPax\n this.needPax = encNumber(buf, off + 337, 8, this.devmin) || this.needPax\n this.needPax = encString(buf, off + 345, prefixSize, prefix) || this.needPax\n if (buf[off + 475] !== 0)\n this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax\n else {\n this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax\n this.needPax = encDate(buf, off + 476, 12, this.atime) || this.needPax\n this.needPax = encDate(buf, off + 488, 12, this.ctime) || this.needPax\n }\n\n let sum = 8 * 0x20\n for (let i = off; i < off + 148; i++)\n sum += buf[i]\n\n for (let i = off + 156; i < off + 512; i++)\n sum += buf[i]\n\n this.cksum = sum\n encNumber(buf, off + 148, 8, this.cksum)\n this.cksumValid = true\n\n return this.needPax\n }\n\n set (data) {\n for (const i in data) {\n if (data[i] !== null && data[i] !== undefined)\n this[i] = data[i]\n }\n }\n\n get type () {\n return types.name.get(this[TYPE]) || this[TYPE]\n }\n\n get typeKey () {\n return this[TYPE]\n }\n\n set type (type) {\n if (types.code.has(type))\n this[TYPE] = types.code.get(type)\n else\n this[TYPE] = type\n }\n}\n\nconst splitPrefix = (p, prefixSize) => {\n const pathSize = 100\n let pp = p\n let prefix = ''\n let ret\n const root = pathModule.parse(p).root || '.'\n\n if (Buffer.byteLength(pp) < pathSize)\n ret = [pp, prefix, false]\n else {\n // first set prefix to the dir, and path to the base\n prefix = pathModule.dirname(pp)\n pp = pathModule.basename(pp)\n\n do {\n // both fit!\n if (Buffer.byteLength(pp) <= pathSize &&\n Buffer.byteLength(prefix) <= prefixSize)\n ret = [pp, prefix, false]\n\n // prefix fits in prefix, but path doesn't fit in path\n else if (Buffer.byteLength(pp) > pathSize &&\n Buffer.byteLength(prefix) <= prefixSize)\n ret = [pp.substr(0, pathSize - 1), prefix, true]\n\n else {\n // make path take a bit from prefix\n pp = pathModule.join(pathModule.basename(prefix), pp)\n prefix = pathModule.dirname(prefix)\n }\n } while (prefix !== root && !ret)\n\n // at this point, found no resolution, just truncate\n if (!ret)\n ret = [p.substr(0, pathSize - 1), '', true]\n }\n return ret\n}\n\nconst decString = (buf, off, size) =>\n buf.slice(off, off + size).toString('utf8').replace(/\\0.*/, '')\n\nconst decDate = (buf, off, size) =>\n numToDate(decNumber(buf, off, size))\n\nconst numToDate = num => num === null ? null : new Date(num * 1000)\n\nconst decNumber = (buf, off, size) =>\n buf[off] & 0x80 ? large.parse(buf.slice(off, off + size))\n : decSmallNumber(buf, off, size)\n\nconst nanNull = value => isNaN(value) ? null : value\n\nconst decSmallNumber = (buf, off, size) =>\n nanNull(parseInt(\n buf.slice(off, off + size)\n .toString('utf8').replace(/\\0.*$/, '').trim(), 8))\n\n// the maximum encodable as a null-terminated octal, by field size\nconst MAXNUM = {\n 12: 0o77777777777,\n 8: 0o7777777,\n}\n\nconst encNumber = (buf, off, size, number) =>\n number === null ? false :\n number > MAXNUM[size] || number < 0\n ? (large.encode(number, buf.slice(off, off + size)), true)\n : (encSmallNumber(buf, off, size, number), false)\n\nconst encSmallNumber = (buf, off, size, number) =>\n buf.write(octalString(number, size), off, size, 'ascii')\n\nconst octalString = (number, size) =>\n padOctal(Math.floor(number).toString(8), size)\n\nconst padOctal = (string, size) =>\n (string.length === size - 1 ? string\n : new Array(size - string.length - 1).join('0') + string + ' ') + '\\0'\n\nconst encDate = (buf, off, size, date) =>\n date === null ? false :\n encNumber(buf, off, size, date.getTime() / 1000)\n\n// enough to fill the longest string we've got\nconst NULLS = new Array(156).join('\\0')\n// pad with nulls, return true if it's longer or non-ascii\nconst encString = (buf, off, size, string) =>\n string === null ? false :\n (buf.write(string + NULLS, off, size, 'utf8'),\n string.length !== Buffer.byteLength(string) || string.length > size)\n\nmodule.exports = Header\n","'use strict'\n\n// turn tar(1) style args like `C` into the more verbose things like `cwd`\n\nconst argmap = new Map([\n ['C', 'cwd'],\n ['f', 'file'],\n ['z', 'gzip'],\n ['P', 'preservePaths'],\n ['U', 'unlink'],\n ['strip-components', 'strip'],\n ['stripComponents', 'strip'],\n ['keep-newer', 'newer'],\n ['keepNewer', 'newer'],\n ['keep-newer-files', 'newer'],\n ['keepNewerFiles', 'newer'],\n ['k', 'keep'],\n ['keep-existing', 'keep'],\n ['keepExisting', 'keep'],\n ['m', 'noMtime'],\n ['no-mtime', 'noMtime'],\n ['p', 'preserveOwner'],\n ['L', 'follow'],\n ['h', 'follow'],\n])\n\nmodule.exports = opt => opt ? Object.keys(opt).map(k => [\n argmap.has(k) ? argmap.get(k) : k, opt[k],\n]).reduce((set, kv) => (set[kv[0]] = kv[1], set), Object.create(null)) : {}\n","'use strict'\n// Tar can encode large and negative numbers using a leading byte of\n// 0xff for negative, and 0x80 for positive.\n\nconst encode = (num, buf) => {\n if (!Number.isSafeInteger(num))\n // The number is so large that javascript cannot represent it with integer\n // precision.\n throw Error('cannot encode number outside of javascript safe integer range')\n else if (num < 0)\n encodeNegative(num, buf)\n else\n encodePositive(num, buf)\n return buf\n}\n\nconst encodePositive = (num, buf) => {\n buf[0] = 0x80\n\n for (var i = buf.length; i > 1; i--) {\n buf[i - 1] = num & 0xff\n num = Math.floor(num / 0x100)\n }\n}\n\nconst encodeNegative = (num, buf) => {\n buf[0] = 0xff\n var flipped = false\n num = num * -1\n for (var i = buf.length; i > 1; i--) {\n var byte = num & 0xff\n num = Math.floor(num / 0x100)\n if (flipped)\n buf[i - 1] = onesComp(byte)\n else if (byte === 0)\n buf[i - 1] = 0\n else {\n flipped = true\n buf[i - 1] = twosComp(byte)\n }\n }\n}\n\nconst parse = (buf) => {\n const pre = buf[0]\n const value = pre === 0x80 ? pos(buf.slice(1, buf.length))\n : pre === 0xff ? twos(buf)\n : null\n if (value === null)\n throw Error('invalid base256 encoding')\n\n if (!Number.isSafeInteger(value))\n // The number is so large that javascript cannot represent it with integer\n // precision.\n throw Error('parsed number outside of javascript safe integer range')\n\n return value\n}\n\nconst twos = (buf) => {\n var len = buf.length\n var sum = 0\n var flipped = false\n for (var i = len - 1; i > -1; i--) {\n var byte = buf[i]\n var f\n if (flipped)\n f = onesComp(byte)\n else if (byte === 0)\n f = byte\n else {\n flipped = true\n f = twosComp(byte)\n }\n if (f !== 0)\n sum -= f * Math.pow(256, len - i - 1)\n }\n return sum\n}\n\nconst pos = (buf) => {\n var len = buf.length\n var sum = 0\n for (var i = len - 1; i > -1; i--) {\n var byte = buf[i]\n if (byte !== 0)\n sum += byte * Math.pow(256, len - i - 1)\n }\n return sum\n}\n\nconst onesComp = byte => (0xff ^ byte) & 0xff\n\nconst twosComp = byte => ((0xff ^ byte) + 1) & 0xff\n\nmodule.exports = {\n encode,\n parse,\n}\n","'use strict'\n\n// XXX: This shares a lot in common with extract.js\n// maybe some DRY opportunity here?\n\n// tar -t\nconst hlo = require('./high-level-opt.js')\nconst Parser = require('./parse.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst path = require('path')\n\nmodule.exports = (opt_, files, cb) => {\n if (typeof opt_ === 'function')\n cb = opt_, files = null, opt_ = {}\n else if (Array.isArray(opt_))\n files = opt_, opt_ = {}\n\n if (typeof files === 'function')\n cb = files, files = null\n\n if (!files)\n files = []\n else\n files = Array.from(files)\n\n const opt = hlo(opt_)\n\n if (opt.sync && typeof cb === 'function')\n throw new TypeError('callback not supported for sync tar functions')\n\n if (!opt.file && typeof cb === 'function')\n throw new TypeError('callback only supported with file option')\n\n if (files.length)\n filesFilter(opt, files)\n\n if (!opt.noResume)\n onentryFunction(opt)\n\n return opt.file && opt.sync ? listFileSync(opt)\n : opt.file ? listFile(opt, cb)\n : list(opt)\n}\n\nconst onentryFunction = opt => {\n const onentry = opt.onentry\n opt.onentry = onentry ? e => {\n onentry(e)\n e.resume()\n } : e => e.resume()\n}\n\n// construct a filter that limits the file entries listed\n// include child entries if a dir is included\nconst filesFilter = (opt, files) => {\n const map = new Map(files.map(f => [f.replace(/\\/+$/, ''), true]))\n const filter = opt.filter\n\n const mapHas = (file, r) => {\n const root = r || path.parse(file).root || '.'\n const ret = file === root ? false\n : map.has(file) ? map.get(file)\n : mapHas(path.dirname(file), root)\n\n map.set(file, ret)\n return ret\n }\n\n opt.filter = filter\n ? (file, entry) => filter(file, entry) && mapHas(file.replace(/\\/+$/, ''))\n : file => mapHas(file.replace(/\\/+$/, ''))\n}\n\nconst listFileSync = opt => {\n const p = list(opt)\n const file = opt.file\n let threw = true\n let fd\n try {\n const stat = fs.statSync(file)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n if (stat.size < readSize)\n p.end(fs.readFileSync(file))\n else {\n let pos = 0\n const buf = Buffer.allocUnsafe(readSize)\n fd = fs.openSync(file, 'r')\n while (pos < stat.size) {\n const bytesRead = fs.readSync(fd, buf, 0, readSize, pos)\n pos += bytesRead\n p.write(buf.slice(0, bytesRead))\n }\n p.end()\n }\n threw = false\n } finally {\n if (threw && fd) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n }\n }\n}\n\nconst listFile = (opt, cb) => {\n const parse = new Parser(opt)\n const readSize = opt.maxReadSize || 16 * 1024 * 1024\n\n const file = opt.file\n const p = new Promise((resolve, reject) => {\n parse.on('error', reject)\n parse.on('end', resolve)\n\n fs.stat(file, (er, stat) => {\n if (er)\n reject(er)\n else {\n const stream = new fsm.ReadStream(file, {\n readSize: readSize,\n size: stat.size,\n })\n stream.on('error', reject)\n stream.pipe(parse)\n }\n })\n })\n return cb ? p.then(cb, cb) : p\n}\n\nconst list = opt => new Parser(opt)\n","'use strict'\n// wrapper around mkdirp for tar's needs.\n\n// TODO: This should probably be a class, not functionally\n// passing around state in a gazillion args.\n\nconst mkdirp = require('mkdirp')\nconst fs = require('fs')\nconst path = require('path')\nconst chownr = require('chownr')\n\nclass SymlinkError extends Error {\n constructor (symlink, path) {\n super('Cannot extract through symbolic link')\n this.path = path\n this.symlink = symlink\n }\n\n get name () {\n return 'SylinkError'\n }\n}\n\nclass CwdError extends Error {\n constructor (path, code) {\n super(code + ': Cannot cd into \\'' + path + '\\'')\n this.path = path\n this.code = code\n }\n\n get name () {\n return 'CwdError'\n }\n}\n\nmodule.exports = (dir, opt, cb) => {\n // if there's any overlap between mask and mode,\n // then we'll need an explicit chmod\n const umask = opt.umask\n const mode = opt.mode | 0o0700\n const needChmod = (mode & umask) !== 0\n\n const uid = opt.uid\n const gid = opt.gid\n const doChown = typeof uid === 'number' &&\n typeof gid === 'number' &&\n (uid !== opt.processUid || gid !== opt.processGid)\n\n const preserve = opt.preserve\n const unlink = opt.unlink\n const cache = opt.cache\n const cwd = opt.cwd\n\n const done = (er, created) => {\n if (er)\n cb(er)\n else {\n cache.set(dir, true)\n if (created && doChown)\n chownr(created, uid, gid, er => done(er))\n else if (needChmod)\n fs.chmod(dir, mode, cb)\n else\n cb()\n }\n }\n\n if (cache && cache.get(dir) === true)\n return done()\n\n if (dir === cwd) {\n return fs.stat(dir, (er, st) => {\n if (er || !st.isDirectory())\n er = new CwdError(dir, er && er.code || 'ENOTDIR')\n done(er)\n })\n }\n\n if (preserve)\n return mkdirp(dir, {mode}).then(made => done(null, made), done)\n\n const sub = path.relative(cwd, dir)\n const parts = sub.split(/\\/|\\\\/)\n mkdir_(cwd, parts, mode, cache, unlink, cwd, null, done)\n}\n\nconst mkdir_ = (base, parts, mode, cache, unlink, cwd, created, cb) => {\n if (!parts.length)\n return cb(null, created)\n const p = parts.shift()\n const part = base + '/' + p\n if (cache.get(part))\n return mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)\n fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))\n}\n\nconst onmkdir = (part, parts, mode, cache, unlink, cwd, created, cb) => er => {\n if (er) {\n if (er.path && path.dirname(er.path) === cwd &&\n (er.code === 'ENOTDIR' || er.code === 'ENOENT'))\n return cb(new CwdError(cwd, er.code))\n\n fs.lstat(part, (statEr, st) => {\n if (statEr)\n cb(statEr)\n else if (st.isDirectory())\n mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)\n else if (unlink) {\n fs.unlink(part, er => {\n if (er)\n return cb(er)\n fs.mkdir(part, mode, onmkdir(part, parts, mode, cache, unlink, cwd, created, cb))\n })\n } else if (st.isSymbolicLink())\n return cb(new SymlinkError(part, part + '/' + parts.join('/')))\n else\n cb(er)\n })\n } else {\n created = created || part\n mkdir_(part, parts, mode, cache, unlink, cwd, created, cb)\n }\n}\n\nmodule.exports.sync = (dir, opt) => {\n // if there's any overlap between mask and mode,\n // then we'll need an explicit chmod\n const umask = opt.umask\n const mode = opt.mode | 0o0700\n const needChmod = (mode & umask) !== 0\n\n const uid = opt.uid\n const gid = opt.gid\n const doChown = typeof uid === 'number' &&\n typeof gid === 'number' &&\n (uid !== opt.processUid || gid !== opt.processGid)\n\n const preserve = opt.preserve\n const unlink = opt.unlink\n const cache = opt.cache\n const cwd = opt.cwd\n\n const done = (created) => {\n cache.set(dir, true)\n if (created && doChown)\n chownr.sync(created, uid, gid)\n if (needChmod)\n fs.chmodSync(dir, mode)\n }\n\n if (cache && cache.get(dir) === true)\n return done()\n\n if (dir === cwd) {\n let ok = false\n let code = 'ENOTDIR'\n try {\n ok = fs.statSync(dir).isDirectory()\n } catch (er) {\n code = er.code\n } finally {\n if (!ok)\n throw new CwdError(dir, code)\n }\n done()\n return\n }\n\n if (preserve)\n return done(mkdirp.sync(dir, mode))\n\n const sub = path.relative(cwd, dir)\n const parts = sub.split(/\\/|\\\\/)\n let created = null\n for (let p = parts.shift(), part = cwd;\n p && (part += '/' + p);\n p = parts.shift()) {\n if (cache.get(part))\n continue\n\n try {\n fs.mkdirSync(part, mode)\n created = created || part\n cache.set(part, true)\n } catch (er) {\n if (er.path && path.dirname(er.path) === cwd &&\n (er.code === 'ENOTDIR' || er.code === 'ENOENT'))\n return new CwdError(cwd, er.code)\n\n const st = fs.lstatSync(part)\n if (st.isDirectory()) {\n cache.set(part, true)\n continue\n } else if (unlink) {\n fs.unlinkSync(part)\n fs.mkdirSync(part, mode)\n created = created || part\n cache.set(part, true)\n continue\n } else if (st.isSymbolicLink())\n return new SymlinkError(part, part + '/' + parts.join('/'))\n }\n }\n\n return done(created)\n}\n","'use strict'\nmodule.exports = (mode, isDir, portable) => {\n mode &= 0o7777\n\n // in portable mode, use the minimum reasonable umask\n // if this system creates files with 0o664 by default\n // (as some linux distros do), then we'll write the\n // archive with 0o644 instead. Also, don't ever create\n // a file that is not readable/writable by the owner.\n if (portable)\n mode = (mode | 0o600) & ~0o22\n\n // if dirs are readable, then they should be listable\n if (isDir) {\n if (mode & 0o400)\n mode |= 0o100\n if (mode & 0o40)\n mode |= 0o10\n if (mode & 0o4)\n mode |= 0o1\n }\n return mode\n}\n","'use strict'\n\n// A readable tar stream creator\n// Technically, this is a transform stream that you write paths into,\n// and tar format comes out of.\n// The `add()` method is like `write()` but returns this,\n// and end() return `this` as well, so you can\n// do `new Pack(opt).add('files').add('dir').end().pipe(output)\n// You could also do something like:\n// streamOfPaths().pipe(new Pack()).pipe(new fs.WriteStream('out.tar'))\n\nclass PackJob {\n constructor (path, absolute) {\n this.path = path || './'\n this.absolute = absolute\n this.entry = null\n this.stat = null\n this.readdir = null\n this.pending = false\n this.ignore = false\n this.piped = false\n }\n}\n\nconst MiniPass = require('minipass')\nconst zlib = require('minizlib')\nconst ReadEntry = require('./read-entry.js')\nconst WriteEntry = require('./write-entry.js')\nconst WriteEntrySync = WriteEntry.Sync\nconst WriteEntryTar = WriteEntry.Tar\nconst Yallist = require('yallist')\nconst EOF = Buffer.alloc(1024)\nconst ONSTAT = Symbol('onStat')\nconst ENDED = Symbol('ended')\nconst QUEUE = Symbol('queue')\nconst CURRENT = Symbol('current')\nconst PROCESS = Symbol('process')\nconst PROCESSING = Symbol('processing')\nconst PROCESSJOB = Symbol('processJob')\nconst JOBS = Symbol('jobs')\nconst JOBDONE = Symbol('jobDone')\nconst ADDFSENTRY = Symbol('addFSEntry')\nconst ADDTARENTRY = Symbol('addTarEntry')\nconst STAT = Symbol('stat')\nconst READDIR = Symbol('readdir')\nconst ONREADDIR = Symbol('onreaddir')\nconst PIPE = Symbol('pipe')\nconst ENTRY = Symbol('entry')\nconst ENTRYOPT = Symbol('entryOpt')\nconst WRITEENTRYCLASS = Symbol('writeEntryClass')\nconst WRITE = Symbol('write')\nconst ONDRAIN = Symbol('ondrain')\n\nconst fs = require('fs')\nconst path = require('path')\nconst warner = require('./warn-mixin.js')\n\nconst Pack = warner(class Pack extends MiniPass {\n constructor (opt) {\n super(opt)\n opt = opt || Object.create(null)\n this.opt = opt\n this.file = opt.file || ''\n this.cwd = opt.cwd || process.cwd()\n this.maxReadSize = opt.maxReadSize\n this.preservePaths = !!opt.preservePaths\n this.strict = !!opt.strict\n this.noPax = !!opt.noPax\n this.prefix = (opt.prefix || '').replace(/(\\\\|\\/)+$/, '')\n this.linkCache = opt.linkCache || new Map()\n this.statCache = opt.statCache || new Map()\n this.readdirCache = opt.readdirCache || new Map()\n\n this[WRITEENTRYCLASS] = WriteEntry\n if (typeof opt.onwarn === 'function')\n this.on('warn', opt.onwarn)\n\n this.portable = !!opt.portable\n this.zip = null\n if (opt.gzip) {\n if (typeof opt.gzip !== 'object')\n opt.gzip = {}\n if (this.portable)\n opt.gzip.portable = true\n this.zip = new zlib.Gzip(opt.gzip)\n this.zip.on('data', chunk => super.write(chunk))\n this.zip.on('end', _ => super.end())\n this.zip.on('drain', _ => this[ONDRAIN]())\n this.on('resume', _ => this.zip.resume())\n } else\n this.on('drain', this[ONDRAIN])\n\n this.noDirRecurse = !!opt.noDirRecurse\n this.follow = !!opt.follow\n this.noMtime = !!opt.noMtime\n this.mtime = opt.mtime || null\n\n this.filter = typeof opt.filter === 'function' ? opt.filter : _ => true\n\n this[QUEUE] = new Yallist()\n this[JOBS] = 0\n this.jobs = +opt.jobs || 4\n this[PROCESSING] = false\n this[ENDED] = false\n }\n\n [WRITE] (chunk) {\n return super.write(chunk)\n }\n\n add (path) {\n this.write(path)\n return this\n }\n\n end (path) {\n if (path)\n this.write(path)\n this[ENDED] = true\n this[PROCESS]()\n return this\n }\n\n write (path) {\n if (this[ENDED])\n throw new Error('write after end')\n\n if (path instanceof ReadEntry)\n this[ADDTARENTRY](path)\n else\n this[ADDFSENTRY](path)\n return this.flowing\n }\n\n [ADDTARENTRY] (p) {\n const absolute = path.resolve(this.cwd, p.path)\n if (this.prefix)\n p.path = this.prefix + '/' + p.path.replace(/^\\.(\\/+|$)/, '')\n\n // in this case, we don't have to wait for the stat\n if (!this.filter(p.path, p))\n p.resume()\n else {\n const job = new PackJob(p.path, absolute, false)\n job.entry = new WriteEntryTar(p, this[ENTRYOPT](job))\n job.entry.on('end', _ => this[JOBDONE](job))\n this[JOBS] += 1\n this[QUEUE].push(job)\n }\n\n this[PROCESS]()\n }\n\n [ADDFSENTRY] (p) {\n const absolute = path.resolve(this.cwd, p)\n if (this.prefix)\n p = this.prefix + '/' + p.replace(/^\\.(\\/+|$)/, '')\n\n this[QUEUE].push(new PackJob(p, absolute))\n this[PROCESS]()\n }\n\n [STAT] (job) {\n job.pending = true\n this[JOBS] += 1\n const stat = this.follow ? 'stat' : 'lstat'\n fs[stat](job.absolute, (er, stat) => {\n job.pending = false\n this[JOBS] -= 1\n if (er)\n this.emit('error', er)\n else\n this[ONSTAT](job, stat)\n })\n }\n\n [ONSTAT] (job, stat) {\n this.statCache.set(job.absolute, stat)\n job.stat = stat\n\n // now we have the stat, we can filter it.\n if (!this.filter(job.path, stat))\n job.ignore = true\n\n this[PROCESS]()\n }\n\n [READDIR] (job) {\n job.pending = true\n this[JOBS] += 1\n fs.readdir(job.absolute, (er, entries) => {\n job.pending = false\n this[JOBS] -= 1\n if (er)\n return this.emit('error', er)\n this[ONREADDIR](job, entries)\n })\n }\n\n [ONREADDIR] (job, entries) {\n this.readdirCache.set(job.absolute, entries)\n job.readdir = entries\n this[PROCESS]()\n }\n\n [PROCESS] () {\n if (this[PROCESSING])\n return\n\n this[PROCESSING] = true\n for (let w = this[QUEUE].head;\n w !== null && this[JOBS] < this.jobs;\n w = w.next) {\n this[PROCESSJOB](w.value)\n if (w.value.ignore) {\n const p = w.next\n this[QUEUE].removeNode(w)\n w.next = p\n }\n }\n\n this[PROCESSING] = false\n\n if (this[ENDED] && !this[QUEUE].length && this[JOBS] === 0) {\n if (this.zip)\n this.zip.end(EOF)\n else {\n super.write(EOF)\n super.end()\n }\n }\n }\n\n get [CURRENT] () {\n return this[QUEUE] && this[QUEUE].head && this[QUEUE].head.value\n }\n\n [JOBDONE] (job) {\n this[QUEUE].shift()\n this[JOBS] -= 1\n this[PROCESS]()\n }\n\n [PROCESSJOB] (job) {\n if (job.pending)\n return\n\n if (job.entry) {\n if (job === this[CURRENT] && !job.piped)\n this[PIPE](job)\n return\n }\n\n if (!job.stat) {\n if (this.statCache.has(job.absolute))\n this[ONSTAT](job, this.statCache.get(job.absolute))\n else\n this[STAT](job)\n }\n if (!job.stat)\n return\n\n // filtered out!\n if (job.ignore)\n return\n\n if (!this.noDirRecurse && job.stat.isDirectory() && !job.readdir) {\n if (this.readdirCache.has(job.absolute))\n this[ONREADDIR](job, this.readdirCache.get(job.absolute))\n else\n this[READDIR](job)\n if (!job.readdir)\n return\n }\n\n // we know it doesn't have an entry, because that got checked above\n job.entry = this[ENTRY](job)\n if (!job.entry) {\n job.ignore = true\n return\n }\n\n if (job === this[CURRENT] && !job.piped)\n this[PIPE](job)\n }\n\n [ENTRYOPT] (job) {\n return {\n onwarn: (code, msg, data) => this.warn(code, msg, data),\n noPax: this.noPax,\n cwd: this.cwd,\n absolute: job.absolute,\n preservePaths: this.preservePaths,\n maxReadSize: this.maxReadSize,\n strict: this.strict,\n portable: this.portable,\n linkCache: this.linkCache,\n statCache: this.statCache,\n noMtime: this.noMtime,\n mtime: this.mtime,\n }\n }\n\n [ENTRY] (job) {\n this[JOBS] += 1\n try {\n return new this[WRITEENTRYCLASS](job.path, this[ENTRYOPT](job))\n .on('end', () => this[JOBDONE](job))\n .on('error', er => this.emit('error', er))\n } catch (er) {\n this.emit('error', er)\n }\n }\n\n [ONDRAIN] () {\n if (this[CURRENT] && this[CURRENT].entry)\n this[CURRENT].entry.resume()\n }\n\n // like .pipe() but using super, because our write() is special\n [PIPE] (job) {\n job.piped = true\n\n if (job.readdir) {\n job.readdir.forEach(entry => {\n const p = this.prefix ?\n job.path.slice(this.prefix.length + 1) || './'\n : job.path\n\n const base = p === './' ? '' : p.replace(/\\/*$/, '/')\n this[ADDFSENTRY](base + entry)\n })\n }\n\n const source = job.entry\n const zip = this.zip\n\n if (zip) {\n source.on('data', chunk => {\n if (!zip.write(chunk))\n source.pause()\n })\n } else {\n source.on('data', chunk => {\n if (!super.write(chunk))\n source.pause()\n })\n }\n }\n\n pause () {\n if (this.zip)\n this.zip.pause()\n return super.pause()\n }\n})\n\nclass PackSync extends Pack {\n constructor (opt) {\n super(opt)\n this[WRITEENTRYCLASS] = WriteEntrySync\n }\n\n // pause/resume are no-ops in sync streams.\n pause () {}\n resume () {}\n\n [STAT] (job) {\n const stat = this.follow ? 'statSync' : 'lstatSync'\n this[ONSTAT](job, fs[stat](job.absolute))\n }\n\n [READDIR] (job, stat) {\n this[ONREADDIR](job, fs.readdirSync(job.absolute))\n }\n\n // gotta get it all in this tick\n [PIPE] (job) {\n const source = job.entry\n const zip = this.zip\n\n if (job.readdir) {\n job.readdir.forEach(entry => {\n const p = this.prefix ?\n job.path.slice(this.prefix.length + 1) || './'\n : job.path\n\n const base = p === './' ? '' : p.replace(/\\/*$/, '/')\n this[ADDFSENTRY](base + entry)\n })\n }\n\n if (zip) {\n source.on('data', chunk => {\n zip.write(chunk)\n })\n } else {\n source.on('data', chunk => {\n super[WRITE](chunk)\n })\n }\n }\n}\n\nPack.Sync = PackSync\n\nmodule.exports = Pack\n","'use strict'\n\n// this[BUFFER] is the remainder of a chunk if we're waiting for\n// the full 512 bytes of a header to come in. We will Buffer.concat()\n// it to the next write(), which is a mem copy, but a small one.\n//\n// this[QUEUE] is a Yallist of entries that haven't been emitted\n// yet this can only get filled up if the user keeps write()ing after\n// a write() returns false, or does a write() with more than one entry\n//\n// We don't buffer chunks, we always parse them and either create an\n// entry, or push it into the active entry. The ReadEntry class knows\n// to throw data away if .ignore=true\n//\n// Shift entry off the buffer when it emits 'end', and emit 'entry' for\n// the next one in the list.\n//\n// At any time, we're pushing body chunks into the entry at WRITEENTRY,\n// and waiting for 'end' on the entry at READENTRY\n//\n// ignored entries get .resume() called on them straight away\n\nconst warner = require('./warn-mixin.js')\nconst Header = require('./header.js')\nconst EE = require('events')\nconst Yallist = require('yallist')\nconst maxMetaEntrySize = 1024 * 1024\nconst Entry = require('./read-entry.js')\nconst Pax = require('./pax.js')\nconst zlib = require('minizlib')\n\nconst gzipHeader = Buffer.from([0x1f, 0x8b])\nconst STATE = Symbol('state')\nconst WRITEENTRY = Symbol('writeEntry')\nconst READENTRY = Symbol('readEntry')\nconst NEXTENTRY = Symbol('nextEntry')\nconst PROCESSENTRY = Symbol('processEntry')\nconst EX = Symbol('extendedHeader')\nconst GEX = Symbol('globalExtendedHeader')\nconst META = Symbol('meta')\nconst EMITMETA = Symbol('emitMeta')\nconst BUFFER = Symbol('buffer')\nconst QUEUE = Symbol('queue')\nconst ENDED = Symbol('ended')\nconst EMITTEDEND = Symbol('emittedEnd')\nconst EMIT = Symbol('emit')\nconst UNZIP = Symbol('unzip')\nconst CONSUMECHUNK = Symbol('consumeChunk')\nconst CONSUMECHUNKSUB = Symbol('consumeChunkSub')\nconst CONSUMEBODY = Symbol('consumeBody')\nconst CONSUMEMETA = Symbol('consumeMeta')\nconst CONSUMEHEADER = Symbol('consumeHeader')\nconst CONSUMING = Symbol('consuming')\nconst BUFFERCONCAT = Symbol('bufferConcat')\nconst MAYBEEND = Symbol('maybeEnd')\nconst WRITING = Symbol('writing')\nconst ABORTED = Symbol('aborted')\nconst DONE = Symbol('onDone')\nconst SAW_VALID_ENTRY = Symbol('sawValidEntry')\nconst SAW_NULL_BLOCK = Symbol('sawNullBlock')\nconst SAW_EOF = Symbol('sawEOF')\n\nconst noop = _ => true\n\nmodule.exports = warner(class Parser extends EE {\n constructor (opt) {\n opt = opt || {}\n super(opt)\n\n this.file = opt.file || ''\n\n // set to boolean false when an entry starts. 1024 bytes of \\0\n // is technically a valid tarball, albeit a boring one.\n this[SAW_VALID_ENTRY] = null\n\n // these BADARCHIVE errors can't be detected early. listen on DONE.\n this.on(DONE, _ => {\n if (this[STATE] === 'begin' || this[SAW_VALID_ENTRY] === false) {\n // either less than 1 block of data, or all entries were invalid.\n // Either way, probably not even a tarball.\n this.warn('TAR_BAD_ARCHIVE', 'Unrecognized archive format')\n }\n })\n\n if (opt.ondone)\n this.on(DONE, opt.ondone)\n else {\n this.on(DONE, _ => {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n this.emit('close')\n })\n }\n\n this.strict = !!opt.strict\n this.maxMetaEntrySize = opt.maxMetaEntrySize || maxMetaEntrySize\n this.filter = typeof opt.filter === 'function' ? opt.filter : noop\n\n // have to set this so that streams are ok piping into it\n this.writable = true\n this.readable = false\n\n this[QUEUE] = new Yallist()\n this[BUFFER] = null\n this[READENTRY] = null\n this[WRITEENTRY] = null\n this[STATE] = 'begin'\n this[META] = ''\n this[EX] = null\n this[GEX] = null\n this[ENDED] = false\n this[UNZIP] = null\n this[ABORTED] = false\n this[SAW_NULL_BLOCK] = false\n this[SAW_EOF] = false\n if (typeof opt.onwarn === 'function')\n this.on('warn', opt.onwarn)\n if (typeof opt.onentry === 'function')\n this.on('entry', opt.onentry)\n }\n\n [CONSUMEHEADER] (chunk, position) {\n if (this[SAW_VALID_ENTRY] === null)\n this[SAW_VALID_ENTRY] = false\n let header\n try {\n header = new Header(chunk, position, this[EX], this[GEX])\n } catch (er) {\n return this.warn('TAR_ENTRY_INVALID', er)\n }\n\n if (header.nullBlock) {\n if (this[SAW_NULL_BLOCK]) {\n this[SAW_EOF] = true\n // ending an archive with no entries. pointless, but legal.\n if (this[STATE] === 'begin')\n this[STATE] = 'header'\n this[EMIT]('eof')\n } else {\n this[SAW_NULL_BLOCK] = true\n this[EMIT]('nullBlock')\n }\n } else {\n this[SAW_NULL_BLOCK] = false\n if (!header.cksumValid)\n this.warn('TAR_ENTRY_INVALID', 'checksum failure', {header})\n else if (!header.path)\n this.warn('TAR_ENTRY_INVALID', 'path is required', {header})\n else {\n const type = header.type\n if (/^(Symbolic)?Link$/.test(type) && !header.linkpath)\n this.warn('TAR_ENTRY_INVALID', 'linkpath required', {header})\n else if (!/^(Symbolic)?Link$/.test(type) && header.linkpath)\n this.warn('TAR_ENTRY_INVALID', 'linkpath forbidden', {header})\n else {\n const entry = this[WRITEENTRY] = new Entry(header, this[EX], this[GEX])\n\n // we do this for meta & ignored entries as well, because they\n // are still valid tar, or else we wouldn't know to ignore them\n if (!this[SAW_VALID_ENTRY]) {\n if (entry.remain) {\n // this might be the one!\n const onend = () => {\n if (!entry.invalid)\n this[SAW_VALID_ENTRY] = true\n }\n entry.on('end', onend)\n } else\n this[SAW_VALID_ENTRY] = true\n }\n\n if (entry.meta) {\n if (entry.size > this.maxMetaEntrySize) {\n entry.ignore = true\n this[EMIT]('ignoredEntry', entry)\n this[STATE] = 'ignore'\n entry.resume()\n } else if (entry.size > 0) {\n this[META] = ''\n entry.on('data', c => this[META] += c)\n this[STATE] = 'meta'\n }\n } else {\n this[EX] = null\n entry.ignore = entry.ignore || !this.filter(entry.path, entry)\n\n if (entry.ignore) {\n // probably valid, just not something we care about\n this[EMIT]('ignoredEntry', entry)\n this[STATE] = entry.remain ? 'ignore' : 'header'\n entry.resume()\n } else {\n if (entry.remain)\n this[STATE] = 'body'\n else {\n this[STATE] = 'header'\n entry.end()\n }\n\n if (!this[READENTRY]) {\n this[QUEUE].push(entry)\n this[NEXTENTRY]()\n } else\n this[QUEUE].push(entry)\n }\n }\n }\n }\n }\n }\n\n [PROCESSENTRY] (entry) {\n let go = true\n\n if (!entry) {\n this[READENTRY] = null\n go = false\n } else if (Array.isArray(entry))\n this.emit.apply(this, entry)\n else {\n this[READENTRY] = entry\n this.emit('entry', entry)\n if (!entry.emittedEnd) {\n entry.on('end', _ => this[NEXTENTRY]())\n go = false\n }\n }\n\n return go\n }\n\n [NEXTENTRY] () {\n do {} while (this[PROCESSENTRY](this[QUEUE].shift()))\n\n if (!this[QUEUE].length) {\n // At this point, there's nothing in the queue, but we may have an\n // entry which is being consumed (readEntry).\n // If we don't, then we definitely can handle more data.\n // If we do, and either it's flowing, or it has never had any data\n // written to it, then it needs more.\n // The only other possibility is that it has returned false from a\n // write() call, so we wait for the next drain to continue.\n const re = this[READENTRY]\n const drainNow = !re || re.flowing || re.size === re.remain\n if (drainNow) {\n if (!this[WRITING])\n this.emit('drain')\n } else\n re.once('drain', _ => this.emit('drain'))\n }\n }\n\n [CONSUMEBODY] (chunk, position) {\n // write up to but no more than writeEntry.blockRemain\n const entry = this[WRITEENTRY]\n const br = entry.blockRemain\n const c = (br >= chunk.length && position === 0) ? chunk\n : chunk.slice(position, position + br)\n\n entry.write(c)\n\n if (!entry.blockRemain) {\n this[STATE] = 'header'\n this[WRITEENTRY] = null\n entry.end()\n }\n\n return c.length\n }\n\n [CONSUMEMETA] (chunk, position) {\n const entry = this[WRITEENTRY]\n const ret = this[CONSUMEBODY](chunk, position)\n\n // if we finished, then the entry is reset\n if (!this[WRITEENTRY])\n this[EMITMETA](entry)\n\n return ret\n }\n\n [EMIT] (ev, data, extra) {\n if (!this[QUEUE].length && !this[READENTRY])\n this.emit(ev, data, extra)\n else\n this[QUEUE].push([ev, data, extra])\n }\n\n [EMITMETA] (entry) {\n this[EMIT]('meta', this[META])\n switch (entry.type) {\n case 'ExtendedHeader':\n case 'OldExtendedHeader':\n this[EX] = Pax.parse(this[META], this[EX], false)\n break\n\n case 'GlobalExtendedHeader':\n this[GEX] = Pax.parse(this[META], this[GEX], true)\n break\n\n case 'NextFileHasLongPath':\n case 'OldGnuLongPath':\n this[EX] = this[EX] || Object.create(null)\n this[EX].path = this[META].replace(/\\0.*/, '')\n break\n\n case 'NextFileHasLongLinkpath':\n this[EX] = this[EX] || Object.create(null)\n this[EX].linkpath = this[META].replace(/\\0.*/, '')\n break\n\n /* istanbul ignore next */\n default: throw new Error('unknown meta: ' + entry.type)\n }\n }\n\n abort (error) {\n this[ABORTED] = true\n this.emit('abort', error)\n // always throws, even in non-strict mode\n this.warn('TAR_ABORT', error, { recoverable: false })\n }\n\n write (chunk) {\n if (this[ABORTED])\n return\n\n // first write, might be gzipped\n if (this[UNZIP] === null && chunk) {\n if (this[BUFFER]) {\n chunk = Buffer.concat([this[BUFFER], chunk])\n this[BUFFER] = null\n }\n if (chunk.length < gzipHeader.length) {\n this[BUFFER] = chunk\n return true\n }\n for (let i = 0; this[UNZIP] === null && i < gzipHeader.length; i++) {\n if (chunk[i] !== gzipHeader[i])\n this[UNZIP] = false\n }\n if (this[UNZIP] === null) {\n const ended = this[ENDED]\n this[ENDED] = false\n this[UNZIP] = new zlib.Unzip()\n this[UNZIP].on('data', chunk => this[CONSUMECHUNK](chunk))\n this[UNZIP].on('error', er => this.abort(er))\n this[UNZIP].on('end', _ => {\n this[ENDED] = true\n this[CONSUMECHUNK]()\n })\n this[WRITING] = true\n const ret = this[UNZIP][ended ? 'end' : 'write'](chunk)\n this[WRITING] = false\n return ret\n }\n }\n\n this[WRITING] = true\n if (this[UNZIP])\n this[UNZIP].write(chunk)\n else\n this[CONSUMECHUNK](chunk)\n this[WRITING] = false\n\n // return false if there's a queue, or if the current entry isn't flowing\n const ret =\n this[QUEUE].length ? false :\n this[READENTRY] ? this[READENTRY].flowing :\n true\n\n // if we have no queue, then that means a clogged READENTRY\n if (!ret && !this[QUEUE].length)\n this[READENTRY].once('drain', _ => this.emit('drain'))\n\n return ret\n }\n\n [BUFFERCONCAT] (c) {\n if (c && !this[ABORTED])\n this[BUFFER] = this[BUFFER] ? Buffer.concat([this[BUFFER], c]) : c\n }\n\n [MAYBEEND] () {\n if (this[ENDED] &&\n !this[EMITTEDEND] &&\n !this[ABORTED] &&\n !this[CONSUMING]) {\n this[EMITTEDEND] = true\n const entry = this[WRITEENTRY]\n if (entry && entry.blockRemain) {\n // truncated, likely a damaged file\n const have = this[BUFFER] ? this[BUFFER].length : 0\n this.warn('TAR_BAD_ARCHIVE', `Truncated input (needed ${\n entry.blockRemain} more bytes, only ${have} available)`, {entry})\n if (this[BUFFER])\n entry.write(this[BUFFER])\n entry.end()\n }\n this[EMIT](DONE)\n }\n }\n\n [CONSUMECHUNK] (chunk) {\n if (this[CONSUMING])\n this[BUFFERCONCAT](chunk)\n else if (!chunk && !this[BUFFER])\n this[MAYBEEND]()\n else {\n this[CONSUMING] = true\n if (this[BUFFER]) {\n this[BUFFERCONCAT](chunk)\n const c = this[BUFFER]\n this[BUFFER] = null\n this[CONSUMECHUNKSUB](c)\n } else\n this[CONSUMECHUNKSUB](chunk)\n\n while (this[BUFFER] &&\n this[BUFFER].length >= 512 &&\n !this[ABORTED] &&\n !this[SAW_EOF]) {\n const c = this[BUFFER]\n this[BUFFER] = null\n this[CONSUMECHUNKSUB](c)\n }\n this[CONSUMING] = false\n }\n\n if (!this[BUFFER] || this[ENDED])\n this[MAYBEEND]()\n }\n\n [CONSUMECHUNKSUB] (chunk) {\n // we know that we are in CONSUMING mode, so anything written goes into\n // the buffer. Advance the position and put any remainder in the buffer.\n let position = 0\n const length = chunk.length\n while (position + 512 <= length && !this[ABORTED] && !this[SAW_EOF]) {\n switch (this[STATE]) {\n case 'begin':\n case 'header':\n this[CONSUMEHEADER](chunk, position)\n position += 512\n break\n\n case 'ignore':\n case 'body':\n position += this[CONSUMEBODY](chunk, position)\n break\n\n case 'meta':\n position += this[CONSUMEMETA](chunk, position)\n break\n\n /* istanbul ignore next */\n default:\n throw new Error('invalid state: ' + this[STATE])\n }\n }\n\n if (position < length) {\n if (this[BUFFER])\n this[BUFFER] = Buffer.concat([chunk.slice(position), this[BUFFER]])\n else\n this[BUFFER] = chunk.slice(position)\n }\n }\n\n end (chunk) {\n if (!this[ABORTED]) {\n if (this[UNZIP])\n this[UNZIP].end(chunk)\n else {\n this[ENDED] = true\n this.write(chunk)\n }\n }\n }\n})\n","// A path exclusive reservation system\n// reserve([list, of, paths], fn)\n// When the fn is first in line for all its paths, it\n// is called with a cb that clears the reservation.\n//\n// Used by async unpack to avoid clobbering paths in use,\n// while still allowing maximal safe parallelization.\n\nconst assert = require('assert')\n\nmodule.exports = () => {\n // path => [function or Set]\n // A Set object means a directory reservation\n // A fn is a direct reservation on that path\n const queues = new Map()\n\n // fn => {paths:[path,...], dirs:[path, ...]}\n const reservations = new Map()\n\n // return a set of parent dirs for a given path\n const { join } = require('path')\n const getDirs = path =>\n join(path).split(/[\\\\/]/).slice(0, -1).reduce((set, path) =>\n set.length ? set.concat(join(set[set.length - 1], path)) : [path], [])\n\n // functions currently running\n const running = new Set()\n\n // return the queues for each path the function cares about\n // fn => {paths, dirs}\n const getQueues = fn => {\n const res = reservations.get(fn)\n /* istanbul ignore if - unpossible */\n if (!res)\n throw new Error('function does not have any path reservations')\n return {\n paths: res.paths.map(path => queues.get(path)),\n dirs: [...res.dirs].map(path => queues.get(path)),\n }\n }\n\n // check if fn is first in line for all its paths, and is\n // included in the first set for all its dir queues\n const check = fn => {\n const {paths, dirs} = getQueues(fn)\n return paths.every(q => q[0] === fn) &&\n dirs.every(q => q[0] instanceof Set && q[0].has(fn))\n }\n\n // run the function if it's first in line and not already running\n const run = fn => {\n if (running.has(fn) || !check(fn))\n return false\n running.add(fn)\n fn(() => clear(fn))\n return true\n }\n\n const clear = fn => {\n if (!running.has(fn))\n return false\n\n const { paths, dirs } = reservations.get(fn)\n const next = new Set()\n\n paths.forEach(path => {\n const q = queues.get(path)\n assert.equal(q[0], fn)\n if (q.length === 1)\n queues.delete(path)\n else {\n q.shift()\n if (typeof q[0] === 'function')\n next.add(q[0])\n else\n q[0].forEach(fn => next.add(fn))\n }\n })\n\n dirs.forEach(dir => {\n const q = queues.get(dir)\n assert(q[0] instanceof Set)\n if (q[0].size === 1 && q.length === 1)\n queues.delete(dir)\n else if (q[0].size === 1) {\n q.shift()\n\n // must be a function or else the Set would've been reused\n next.add(q[0])\n } else\n q[0].delete(fn)\n })\n running.delete(fn)\n\n next.forEach(fn => run(fn))\n return true\n }\n\n const reserve = (paths, fn) => {\n const dirs = new Set(\n paths.map(path => getDirs(path)).reduce((a, b) => a.concat(b))\n )\n reservations.set(fn, {dirs, paths})\n paths.forEach(path => {\n const q = queues.get(path)\n if (!q)\n queues.set(path, [fn])\n else\n q.push(fn)\n })\n dirs.forEach(dir => {\n const q = queues.get(dir)\n if (!q)\n queues.set(dir, [new Set([fn])])\n else if (q[q.length - 1] instanceof Set)\n q[q.length - 1].add(fn)\n else\n q.push(new Set([fn]))\n })\n\n return run(fn)\n }\n\n return { check, reserve }\n}\n","'use strict'\nconst Header = require('./header.js')\nconst path = require('path')\n\nclass Pax {\n constructor (obj, global) {\n this.atime = obj.atime || null\n this.charset = obj.charset || null\n this.comment = obj.comment || null\n this.ctime = obj.ctime || null\n this.gid = obj.gid || null\n this.gname = obj.gname || null\n this.linkpath = obj.linkpath || null\n this.mtime = obj.mtime || null\n this.path = obj.path || null\n this.size = obj.size || null\n this.uid = obj.uid || null\n this.uname = obj.uname || null\n this.dev = obj.dev || null\n this.ino = obj.ino || null\n this.nlink = obj.nlink || null\n this.global = global || false\n }\n\n encode () {\n const body = this.encodeBody()\n if (body === '')\n return null\n\n const bodyLen = Buffer.byteLength(body)\n // round up to 512 bytes\n // add 512 for header\n const bufLen = 512 * Math.ceil(1 + bodyLen / 512)\n const buf = Buffer.allocUnsafe(bufLen)\n\n // 0-fill the header section, it might not hit every field\n for (let i = 0; i < 512; i++)\n buf[i] = 0\n\n new Header({\n // XXX split the path\n // then the path should be PaxHeader + basename, but less than 99,\n // prepend with the dirname\n path: ('PaxHeader/' + path.basename(this.path)).slice(0, 99),\n mode: this.mode || 0o644,\n uid: this.uid || null,\n gid: this.gid || null,\n size: bodyLen,\n mtime: this.mtime || null,\n type: this.global ? 'GlobalExtendedHeader' : 'ExtendedHeader',\n linkpath: '',\n uname: this.uname || '',\n gname: this.gname || '',\n devmaj: 0,\n devmin: 0,\n atime: this.atime || null,\n ctime: this.ctime || null,\n }).encode(buf)\n\n buf.write(body, 512, bodyLen, 'utf8')\n\n // null pad after the body\n for (let i = bodyLen + 512; i < buf.length; i++)\n buf[i] = 0\n\n return buf\n }\n\n encodeBody () {\n return (\n this.encodeField('path') +\n this.encodeField('ctime') +\n this.encodeField('atime') +\n this.encodeField('dev') +\n this.encodeField('ino') +\n this.encodeField('nlink') +\n this.encodeField('charset') +\n this.encodeField('comment') +\n this.encodeField('gid') +\n this.encodeField('gname') +\n this.encodeField('linkpath') +\n this.encodeField('mtime') +\n this.encodeField('size') +\n this.encodeField('uid') +\n this.encodeField('uname')\n )\n }\n\n encodeField (field) {\n if (this[field] === null || this[field] === undefined)\n return ''\n const v = this[field] instanceof Date ? this[field].getTime() / 1000\n : this[field]\n const s = ' ' +\n (field === 'dev' || field === 'ino' || field === 'nlink'\n ? 'SCHILY.' : '') +\n field + '=' + v + '\\n'\n const byteLen = Buffer.byteLength(s)\n // the digits includes the length of the digits in ascii base-10\n // so if it's 9 characters, then adding 1 for the 9 makes it 10\n // which makes it 11 chars.\n let digits = Math.floor(Math.log(byteLen) / Math.log(10)) + 1\n if (byteLen + digits >= Math.pow(10, digits))\n digits += 1\n const len = digits + byteLen\n return len + s\n }\n}\n\nPax.parse = (string, ex, g) => new Pax(merge(parseKV(string), ex), g)\n\nconst merge = (a, b) =>\n b ? Object.keys(a).reduce((s, k) => (s[k] = a[k], s), b) : a\n\nconst parseKV = string =>\n string\n .replace(/\\n$/, '')\n .split('\\n')\n .reduce(parseKVLine, Object.create(null))\n\nconst parseKVLine = (set, line) => {\n const n = parseInt(line, 10)\n\n // XXX Values with \\n in them will fail this.\n // Refactor to not be a naive line-by-line parse.\n if (n !== Buffer.byteLength(line) + 1)\n return set\n\n line = line.substr((n + ' ').length)\n const kv = line.split('=')\n const k = kv.shift().replace(/^SCHILY\\.(dev|ino|nlink)/, '$1')\n if (!k)\n return set\n\n const v = kv.join('=')\n set[k] = /^([A-Z]+\\.)?([mac]|birth|creation)time$/.test(k)\n ? new Date(v * 1000)\n : /^[0-9]+$/.test(v) ? +v\n : v\n return set\n}\n\nmodule.exports = Pax\n","'use strict'\nconst MiniPass = require('minipass')\n\nconst SLURP = Symbol('slurp')\nmodule.exports = class ReadEntry extends MiniPass {\n constructor (header, ex, gex) {\n super()\n // read entries always start life paused. this is to avoid the\n // situation where Minipass's auto-ending empty streams results\n // in an entry ending before we're ready for it.\n this.pause()\n this.extended = ex\n this.globalExtended = gex\n this.header = header\n this.startBlockSize = 512 * Math.ceil(header.size / 512)\n this.blockRemain = this.startBlockSize\n this.remain = header.size\n this.type = header.type\n this.meta = false\n this.ignore = false\n switch (this.type) {\n case 'File':\n case 'OldFile':\n case 'Link':\n case 'SymbolicLink':\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'Directory':\n case 'FIFO':\n case 'ContiguousFile':\n case 'GNUDumpDir':\n break\n\n case 'NextFileHasLongLinkpath':\n case 'NextFileHasLongPath':\n case 'OldGnuLongPath':\n case 'GlobalExtendedHeader':\n case 'ExtendedHeader':\n case 'OldExtendedHeader':\n this.meta = true\n break\n\n // NOTE: gnutar and bsdtar treat unrecognized types as 'File'\n // it may be worth doing the same, but with a warning.\n default:\n this.ignore = true\n }\n\n this.path = header.path\n this.mode = header.mode\n if (this.mode)\n this.mode = this.mode & 0o7777\n this.uid = header.uid\n this.gid = header.gid\n this.uname = header.uname\n this.gname = header.gname\n this.size = header.size\n this.mtime = header.mtime\n this.atime = header.atime\n this.ctime = header.ctime\n this.linkpath = header.linkpath\n this.uname = header.uname\n this.gname = header.gname\n\n if (ex)\n this[SLURP](ex)\n if (gex)\n this[SLURP](gex, true)\n }\n\n write (data) {\n const writeLen = data.length\n if (writeLen > this.blockRemain)\n throw new Error('writing more to entry than is appropriate')\n\n const r = this.remain\n const br = this.blockRemain\n this.remain = Math.max(0, r - writeLen)\n this.blockRemain = Math.max(0, br - writeLen)\n if (this.ignore)\n return true\n\n if (r >= writeLen)\n return super.write(data)\n\n // r < writeLen\n return super.write(data.slice(0, r))\n }\n\n [SLURP] (ex, global) {\n for (const k in ex) {\n // we slurp in everything except for the path attribute in\n // a global extended header, because that's weird.\n if (ex[k] !== null && ex[k] !== undefined &&\n !(global && k === 'path'))\n this[k] = ex[k]\n }\n }\n}\n","'use strict'\n\n// tar -r\nconst hlo = require('./high-level-opt.js')\nconst Pack = require('./pack.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst t = require('./list.js')\nconst path = require('path')\n\n// starting at the head of the file, read a Header\n// If the checksum is invalid, that's our position to start writing\n// If it is, jump forward by the specified size (round up to 512)\n// and try again.\n// Write the new Pack stream starting there.\n\nconst Header = require('./header.js')\n\nmodule.exports = (opt_, files, cb) => {\n const opt = hlo(opt_)\n\n if (!opt.file)\n throw new TypeError('file is required')\n\n if (opt.gzip)\n throw new TypeError('cannot append to compressed archives')\n\n if (!files || !Array.isArray(files) || !files.length)\n throw new TypeError('no files or directories specified')\n\n files = Array.from(files)\n\n return opt.sync ? replaceSync(opt, files)\n : replace(opt, files, cb)\n}\n\nconst replaceSync = (opt, files) => {\n const p = new Pack.Sync(opt)\n\n let threw = true\n let fd\n let position\n\n try {\n try {\n fd = fs.openSync(opt.file, 'r+')\n } catch (er) {\n if (er.code === 'ENOENT')\n fd = fs.openSync(opt.file, 'w+')\n else\n throw er\n }\n\n const st = fs.fstatSync(fd)\n const headBuf = Buffer.alloc(512)\n\n POSITION: for (position = 0; position < st.size; position += 512) {\n for (let bufPos = 0, bytes = 0; bufPos < 512; bufPos += bytes) {\n bytes = fs.readSync(\n fd, headBuf, bufPos, headBuf.length - bufPos, position + bufPos\n )\n\n if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b)\n throw new Error('cannot append to compressed archives')\n\n if (!bytes)\n break POSITION\n }\n\n const h = new Header(headBuf)\n if (!h.cksumValid)\n break\n const entryBlockSize = 512 * Math.ceil(h.size / 512)\n if (position + entryBlockSize + 512 > st.size)\n break\n // the 512 for the header we just parsed will be added as well\n // also jump ahead all the blocks for the body\n position += entryBlockSize\n if (opt.mtimeCache)\n opt.mtimeCache.set(h.path, h.mtime)\n }\n threw = false\n\n streamSync(opt, p, position, fd, files)\n } finally {\n if (threw) {\n try {\n fs.closeSync(fd)\n } catch (er) {}\n }\n }\n}\n\nconst streamSync = (opt, p, position, fd, files) => {\n const stream = new fsm.WriteStreamSync(opt.file, {\n fd: fd,\n start: position,\n })\n p.pipe(stream)\n addFilesSync(p, files)\n}\n\nconst replace = (opt, files, cb) => {\n files = Array.from(files)\n const p = new Pack(opt)\n\n const getPos = (fd, size, cb_) => {\n const cb = (er, pos) => {\n if (er)\n fs.close(fd, _ => cb_(er))\n else\n cb_(null, pos)\n }\n\n let position = 0\n if (size === 0)\n return cb(null, 0)\n\n let bufPos = 0\n const headBuf = Buffer.alloc(512)\n const onread = (er, bytes) => {\n if (er)\n return cb(er)\n bufPos += bytes\n if (bufPos < 512 && bytes) {\n return fs.read(\n fd, headBuf, bufPos, headBuf.length - bufPos,\n position + bufPos, onread\n )\n }\n\n if (position === 0 && headBuf[0] === 0x1f && headBuf[1] === 0x8b)\n return cb(new Error('cannot append to compressed archives'))\n\n // truncated header\n if (bufPos < 512)\n return cb(null, position)\n\n const h = new Header(headBuf)\n if (!h.cksumValid)\n return cb(null, position)\n\n const entryBlockSize = 512 * Math.ceil(h.size / 512)\n if (position + entryBlockSize + 512 > size)\n return cb(null, position)\n\n position += entryBlockSize + 512\n if (position >= size)\n return cb(null, position)\n\n if (opt.mtimeCache)\n opt.mtimeCache.set(h.path, h.mtime)\n bufPos = 0\n fs.read(fd, headBuf, 0, 512, position, onread)\n }\n fs.read(fd, headBuf, 0, 512, position, onread)\n }\n\n const promise = new Promise((resolve, reject) => {\n p.on('error', reject)\n let flag = 'r+'\n const onopen = (er, fd) => {\n if (er && er.code === 'ENOENT' && flag === 'r+') {\n flag = 'w+'\n return fs.open(opt.file, flag, onopen)\n }\n\n if (er)\n return reject(er)\n\n fs.fstat(fd, (er, st) => {\n if (er)\n return reject(er)\n getPos(fd, st.size, (er, position) => {\n if (er)\n return reject(er)\n const stream = new fsm.WriteStream(opt.file, {\n fd: fd,\n start: position,\n })\n p.pipe(stream)\n stream.on('error', reject)\n stream.on('close', resolve)\n addFilesAsync(p, files)\n })\n })\n }\n fs.open(opt.file, flag, onopen)\n })\n\n return cb ? promise.then(cb, cb) : promise\n}\n\nconst addFilesSync = (p, files) => {\n files.forEach(file => {\n if (file.charAt(0) === '@') {\n t({\n file: path.resolve(p.cwd, file.substr(1)),\n sync: true,\n noResume: true,\n onentry: entry => p.add(entry),\n })\n } else\n p.add(file)\n })\n p.end()\n}\n\nconst addFilesAsync = (p, files) => {\n while (files.length) {\n const file = files.shift()\n if (file.charAt(0) === '@') {\n return t({\n file: path.resolve(p.cwd, file.substr(1)),\n noResume: true,\n onentry: entry => p.add(entry),\n }).then(_ => addFilesAsync(p, files))\n } else\n p.add(file)\n }\n p.end()\n}\n","'use strict'\n// map types from key to human-friendly name\nexports.name = new Map([\n ['0', 'File'],\n // same as File\n ['', 'OldFile'],\n ['1', 'Link'],\n ['2', 'SymbolicLink'],\n // Devices and FIFOs aren't fully supported\n // they are parsed, but skipped when unpacking\n ['3', 'CharacterDevice'],\n ['4', 'BlockDevice'],\n ['5', 'Directory'],\n ['6', 'FIFO'],\n // same as File\n ['7', 'ContiguousFile'],\n // pax headers\n ['g', 'GlobalExtendedHeader'],\n ['x', 'ExtendedHeader'],\n // vendor-specific stuff\n // skip\n ['A', 'SolarisACL'],\n // like 5, but with data, which should be skipped\n ['D', 'GNUDumpDir'],\n // metadata only, skip\n ['I', 'Inode'],\n // data = link path of next file\n ['K', 'NextFileHasLongLinkpath'],\n // data = path of next file\n ['L', 'NextFileHasLongPath'],\n // skip\n ['M', 'ContinuationFile'],\n // like L\n ['N', 'OldGnuLongPath'],\n // skip\n ['S', 'SparseFile'],\n // skip\n ['V', 'TapeVolumeHeader'],\n // like x\n ['X', 'OldExtendedHeader'],\n])\n\n// map the other direction\nexports.code = new Map(Array.from(exports.name).map(kv => [kv[1], kv[0]]))\n","'use strict'\n\n// the PEND/UNPEND stuff tracks whether we're ready to emit end/close yet.\n// but the path reservations are required to avoid race conditions where\n// parallelized unpack ops may mess with one another, due to dependencies\n// (like a Link depending on its target) or destructive operations (like\n// clobbering an fs object to create one of a different type.)\n\nconst assert = require('assert')\nconst Parser = require('./parse.js')\nconst fs = require('fs')\nconst fsm = require('fs-minipass')\nconst path = require('path')\nconst mkdir = require('./mkdir.js')\nconst wc = require('./winchars.js')\nconst pathReservations = require('./path-reservations.js')\n\nconst ONENTRY = Symbol('onEntry')\nconst CHECKFS = Symbol('checkFs')\nconst CHECKFS2 = Symbol('checkFs2')\nconst ISREUSABLE = Symbol('isReusable')\nconst MAKEFS = Symbol('makeFs')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst LINK = Symbol('link')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst UNSUPPORTED = Symbol('unsupported')\nconst CHECKPATH = Symbol('checkPath')\nconst MKDIR = Symbol('mkdir')\nconst ONERROR = Symbol('onError')\nconst PENDING = Symbol('pending')\nconst PEND = Symbol('pend')\nconst UNPEND = Symbol('unpend')\nconst ENDED = Symbol('ended')\nconst MAYBECLOSE = Symbol('maybeClose')\nconst SKIP = Symbol('skip')\nconst DOCHOWN = Symbol('doChown')\nconst UID = Symbol('uid')\nconst GID = Symbol('gid')\nconst crypto = require('crypto')\nconst getFlag = require('./get-write-flag.js')\n\n/* istanbul ignore next */\nconst neverCalled = () => {\n throw new Error('sync function called cb somehow?!?')\n}\n\n// Unlinks on Windows are not atomic.\n//\n// This means that if you have a file entry, followed by another\n// file entry with an identical name, and you cannot re-use the file\n// (because it's a hardlink, or because unlink:true is set, or it's\n// Windows, which does not have useful nlink values), then the unlink\n// will be committed to the disk AFTER the new file has been written\n// over the old one, deleting the new file.\n//\n// To work around this, on Windows systems, we rename the file and then\n// delete the renamed file. It's a sloppy kludge, but frankly, I do not\n// know of a better way to do this, given windows' non-atomic unlink\n// semantics.\n//\n// See: https://github.com/npm/node-tar/issues/183\n/* istanbul ignore next */\nconst unlinkFile = (path, cb) => {\n if (process.platform !== 'win32')\n return fs.unlink(path, cb)\n\n const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')\n fs.rename(path, name, er => {\n if (er)\n return cb(er)\n fs.unlink(name, cb)\n })\n}\n\n/* istanbul ignore next */\nconst unlinkFileSync = path => {\n if (process.platform !== 'win32')\n return fs.unlinkSync(path)\n\n const name = path + '.DELETE.' + crypto.randomBytes(16).toString('hex')\n fs.renameSync(path, name)\n fs.unlinkSync(name)\n}\n\n// this.gid, entry.gid, this.processUid\nconst uint32 = (a, b, c) =>\n a === a >>> 0 ? a\n : b === b >>> 0 ? b\n : c\n\nclass Unpack extends Parser {\n constructor (opt) {\n if (!opt)\n opt = {}\n\n opt.ondone = _ => {\n this[ENDED] = true\n this[MAYBECLOSE]()\n }\n\n super(opt)\n\n this.reservations = pathReservations()\n\n this.transform = typeof opt.transform === 'function' ? opt.transform : null\n\n this.writable = true\n this.readable = false\n\n this[PENDING] = 0\n this[ENDED] = false\n\n this.dirCache = opt.dirCache || new Map()\n\n if (typeof opt.uid === 'number' || typeof opt.gid === 'number') {\n // need both or neither\n if (typeof opt.uid !== 'number' || typeof opt.gid !== 'number')\n throw new TypeError('cannot set owner without number uid and gid')\n if (opt.preserveOwner) {\n throw new TypeError(\n 'cannot preserve owner in archive and also set owner explicitly')\n }\n this.uid = opt.uid\n this.gid = opt.gid\n this.setOwner = true\n } else {\n this.uid = null\n this.gid = null\n this.setOwner = false\n }\n\n // default true for root\n if (opt.preserveOwner === undefined && typeof opt.uid !== 'number')\n this.preserveOwner = process.getuid && process.getuid() === 0\n else\n this.preserveOwner = !!opt.preserveOwner\n\n this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ?\n process.getuid() : null\n this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ?\n process.getgid() : null\n\n // mostly just for testing, but useful in some cases.\n // Forcibly trigger a chown on every entry, no matter what\n this.forceChown = opt.forceChown === true\n\n // turn > this[ONENTRY](entry))\n }\n\n // a bad or damaged archive is a warning for Parser, but an error\n // when extracting. Mark those errors as unrecoverable, because\n // the Unpack contract cannot be met.\n warn (code, msg, data = {}) {\n if (code === 'TAR_BAD_ARCHIVE' || code === 'TAR_ABORT')\n data.recoverable = false\n return super.warn(code, msg, data)\n }\n\n [MAYBECLOSE] () {\n if (this[ENDED] && this[PENDING] === 0) {\n this.emit('prefinish')\n this.emit('finish')\n this.emit('end')\n this.emit('close')\n }\n }\n\n [CHECKPATH] (entry) {\n if (this.strip) {\n const parts = entry.path.split(/\\/|\\\\/)\n if (parts.length < this.strip)\n return false\n entry.path = parts.slice(this.strip).join('/')\n\n if (entry.type === 'Link') {\n const linkparts = entry.linkpath.split(/\\/|\\\\/)\n if (linkparts.length >= this.strip)\n entry.linkpath = linkparts.slice(this.strip).join('/')\n }\n }\n\n if (!this.preservePaths) {\n const p = entry.path\n if (p.match(/(^|\\/|\\\\)\\.\\.(\\\\|\\/|$)/)) {\n this.warn('TAR_ENTRY_ERROR', `path contains '..'`, {\n entry,\n path: p,\n })\n return false\n }\n\n // absolutes on posix are also absolutes on win32\n // so we only need to test this one to get both\n if (path.win32.isAbsolute(p)) {\n const parsed = path.win32.parse(p)\n entry.path = p.substr(parsed.root.length)\n const r = parsed.root\n this.warn('TAR_ENTRY_INFO', `stripping ${r} from absolute path`, {\n entry,\n path: p,\n })\n }\n }\n\n // only encode : chars that aren't drive letter indicators\n if (this.win32) {\n const parsed = path.win32.parse(entry.path)\n entry.path = parsed.root === '' ? wc.encode(entry.path)\n : parsed.root + wc.encode(entry.path.substr(parsed.root.length))\n }\n\n if (path.isAbsolute(entry.path))\n entry.absolute = entry.path\n else\n entry.absolute = path.resolve(this.cwd, entry.path)\n\n return true\n }\n\n [ONENTRY] (entry) {\n if (!this[CHECKPATH](entry))\n return entry.resume()\n\n assert.equal(typeof entry.absolute, 'string')\n\n switch (entry.type) {\n case 'Directory':\n case 'GNUDumpDir':\n if (entry.mode)\n entry.mode = entry.mode | 0o700\n\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n case 'Link':\n case 'SymbolicLink':\n return this[CHECKFS](entry)\n\n case 'CharacterDevice':\n case 'BlockDevice':\n case 'FIFO':\n default:\n return this[UNSUPPORTED](entry)\n }\n }\n\n [ONERROR] (er, entry) {\n // Cwd has to exist, or else nothing works. That's serious.\n // Other errors are warnings, which raise the error in strict\n // mode, but otherwise continue on.\n if (er.name === 'CwdError')\n this.emit('error', er)\n else {\n this.warn('TAR_ENTRY_ERROR', er, {entry})\n this[UNPEND]()\n entry.resume()\n }\n }\n\n [MKDIR] (dir, mode, cb) {\n mkdir(dir, {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cache: this.dirCache,\n cwd: this.cwd,\n mode: mode,\n noChmod: this.noChmod,\n }, cb)\n }\n\n [DOCHOWN] (entry) {\n // in preserve owner mode, chown if the entry doesn't match process\n // in set owner mode, chown if setting doesn't match process\n return this.forceChown ||\n this.preserveOwner &&\n (typeof entry.uid === 'number' && entry.uid !== this.processUid ||\n typeof entry.gid === 'number' && entry.gid !== this.processGid)\n ||\n (typeof this.uid === 'number' && this.uid !== this.processUid ||\n typeof this.gid === 'number' && this.gid !== this.processGid)\n }\n\n [UID] (entry) {\n return uint32(this.uid, entry.uid, this.processUid)\n }\n\n [GID] (entry) {\n return uint32(this.gid, entry.gid, this.processGid)\n }\n\n [FILE] (entry, fullyDone) {\n const mode = entry.mode & 0o7777 || this.fmode\n const stream = new fsm.WriteStream(entry.absolute, {\n flags: getFlag(entry.size),\n mode: mode,\n autoClose: false,\n })\n stream.on('error', er => this[ONERROR](er, entry))\n\n let actions = 1\n const done = er => {\n if (er)\n return this[ONERROR](er, entry)\n\n if (--actions === 0) {\n fs.close(stream.fd, er => {\n fullyDone()\n er ? this[ONERROR](er, entry) : this[UNPEND]()\n })\n }\n }\n\n stream.on('finish', _ => {\n // if futimes fails, try utimes\n // if utimes fails, fail with the original error\n // same for fchown/chown\n const abs = entry.absolute\n const fd = stream.fd\n\n if (entry.mtime && !this.noMtime) {\n actions++\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n fs.futimes(fd, atime, mtime, er =>\n er ? fs.utimes(abs, atime, mtime, er2 => done(er2 && er))\n : done())\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n fs.fchown(fd, uid, gid, er =>\n er ? fs.chown(abs, uid, gid, er2 => done(er2 && er))\n : done())\n }\n\n done()\n })\n\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', er => this[ONERROR](er, entry))\n entry.pipe(tx)\n }\n tx.pipe(stream)\n }\n\n [DIRECTORY] (entry, fullyDone) {\n const mode = entry.mode & 0o7777 || this.dmode\n this[MKDIR](entry.absolute, mode, er => {\n if (er) {\n fullyDone()\n return this[ONERROR](er, entry)\n }\n\n let actions = 1\n const done = _ => {\n if (--actions === 0) {\n fullyDone()\n this[UNPEND]()\n entry.resume()\n }\n }\n\n if (entry.mtime && !this.noMtime) {\n actions++\n fs.utimes(entry.absolute, entry.atime || new Date(), entry.mtime, done)\n }\n\n if (this[DOCHOWN](entry)) {\n actions++\n fs.chown(entry.absolute, this[UID](entry), this[GID](entry), done)\n }\n\n done()\n })\n }\n\n [UNSUPPORTED] (entry) {\n entry.unsupported = true\n this.warn('TAR_ENTRY_UNSUPPORTED',\n `unsupported entry type: ${entry.type}`, {entry})\n entry.resume()\n }\n\n [SYMLINK] (entry, done) {\n this[LINK](entry, entry.linkpath, 'symlink', done)\n }\n\n [HARDLINK] (entry, done) {\n this[LINK](entry, path.resolve(this.cwd, entry.linkpath), 'link', done)\n }\n\n [PEND] () {\n this[PENDING]++\n }\n\n [UNPEND] () {\n this[PENDING]--\n this[MAYBECLOSE]()\n }\n\n [SKIP] (entry) {\n this[UNPEND]()\n entry.resume()\n }\n\n // Check if we can reuse an existing filesystem entry safely and\n // overwrite it, rather than unlinking and recreating\n // Windows doesn't report a useful nlink, so we just never reuse entries\n [ISREUSABLE] (entry, st) {\n return entry.type === 'File' &&\n !this.unlink &&\n st.isFile() &&\n st.nlink <= 1 &&\n process.platform !== 'win32'\n }\n\n // check if a thing is there, and if so, try to clobber it\n [CHECKFS] (entry) {\n this[PEND]()\n const paths = [entry.path]\n if (entry.linkpath)\n paths.push(entry.linkpath)\n this.reservations.reserve(paths, done => this[CHECKFS2](entry, done))\n }\n\n [CHECKFS2] (entry, done) {\n this[MKDIR](path.dirname(entry.absolute), this.dmode, er => {\n if (er) {\n done()\n return this[ONERROR](er, entry)\n }\n fs.lstat(entry.absolute, (er, st) => {\n if (st && (this.keep || this.newer && st.mtime > entry.mtime)) {\n this[SKIP](entry)\n done()\n } else if (er || this[ISREUSABLE](entry, st))\n this[MAKEFS](null, entry, done)\n\n else if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n if (!this.noChmod && (!entry.mode || (st.mode & 0o7777) === entry.mode))\n this[MAKEFS](null, entry, done)\n else {\n fs.chmod(entry.absolute, entry.mode,\n er => this[MAKEFS](er, entry, done))\n }\n } else\n fs.rmdir(entry.absolute, er => this[MAKEFS](er, entry, done))\n } else\n unlinkFile(entry.absolute, er => this[MAKEFS](er, entry, done))\n })\n })\n }\n\n [MAKEFS] (er, entry, done) {\n if (er)\n return this[ONERROR](er, entry)\n\n switch (entry.type) {\n case 'File':\n case 'OldFile':\n case 'ContiguousFile':\n return this[FILE](entry, done)\n\n case 'Link':\n return this[HARDLINK](entry, done)\n\n case 'SymbolicLink':\n return this[SYMLINK](entry, done)\n\n case 'Directory':\n case 'GNUDumpDir':\n return this[DIRECTORY](entry, done)\n }\n }\n\n [LINK] (entry, linkpath, link, done) {\n // XXX: get the type ('file' or 'dir') for windows\n fs[link](linkpath, entry.absolute, er => {\n if (er)\n return this[ONERROR](er, entry)\n done()\n this[UNPEND]()\n entry.resume()\n })\n }\n}\n\nclass UnpackSync extends Unpack {\n [CHECKFS] (entry) {\n const er = this[MKDIR](path.dirname(entry.absolute), this.dmode, neverCalled)\n if (er)\n return this[ONERROR](er, entry)\n try {\n const st = fs.lstatSync(entry.absolute)\n if (this.keep || this.newer && st.mtime > entry.mtime)\n return this[SKIP](entry)\n else if (this[ISREUSABLE](entry, st))\n return this[MAKEFS](null, entry, neverCalled)\n else {\n try {\n if (st.isDirectory()) {\n if (entry.type === 'Directory') {\n if (!this.noChmod && entry.mode && (st.mode & 0o7777) !== entry.mode)\n fs.chmodSync(entry.absolute, entry.mode)\n } else\n fs.rmdirSync(entry.absolute)\n } else\n unlinkFileSync(entry.absolute)\n return this[MAKEFS](null, entry, neverCalled)\n } catch (er) {\n return this[ONERROR](er, entry)\n }\n }\n } catch (er) {\n return this[MAKEFS](null, entry, neverCalled)\n }\n }\n\n [FILE] (entry, _) {\n const mode = entry.mode & 0o7777 || this.fmode\n\n const oner = er => {\n let closeError\n try {\n fs.closeSync(fd)\n } catch (e) {\n closeError = e\n }\n if (er || closeError)\n this[ONERROR](er || closeError, entry)\n }\n\n let fd\n try {\n fd = fs.openSync(entry.absolute, getFlag(entry.size), mode)\n } catch (er) {\n return oner(er)\n }\n const tx = this.transform ? this.transform(entry) || entry : entry\n if (tx !== entry) {\n tx.on('error', er => this[ONERROR](er, entry))\n entry.pipe(tx)\n }\n\n tx.on('data', chunk => {\n try {\n fs.writeSync(fd, chunk, 0, chunk.length)\n } catch (er) {\n oner(er)\n }\n })\n\n tx.on('end', _ => {\n let er = null\n // try both, falling futimes back to utimes\n // if either fails, handle the first error\n if (entry.mtime && !this.noMtime) {\n const atime = entry.atime || new Date()\n const mtime = entry.mtime\n try {\n fs.futimesSync(fd, atime, mtime)\n } catch (futimeser) {\n try {\n fs.utimesSync(entry.absolute, atime, mtime)\n } catch (utimeser) {\n er = futimeser\n }\n }\n }\n\n if (this[DOCHOWN](entry)) {\n const uid = this[UID](entry)\n const gid = this[GID](entry)\n\n try {\n fs.fchownSync(fd, uid, gid)\n } catch (fchowner) {\n try {\n fs.chownSync(entry.absolute, uid, gid)\n } catch (chowner) {\n er = er || fchowner\n }\n }\n }\n\n oner(er)\n })\n }\n\n [DIRECTORY] (entry, _) {\n const mode = entry.mode & 0o7777 || this.dmode\n const er = this[MKDIR](entry.absolute, mode)\n if (er)\n return this[ONERROR](er, entry)\n if (entry.mtime && !this.noMtime) {\n try {\n fs.utimesSync(entry.absolute, entry.atime || new Date(), entry.mtime)\n } catch (er) {}\n }\n if (this[DOCHOWN](entry)) {\n try {\n fs.chownSync(entry.absolute, this[UID](entry), this[GID](entry))\n } catch (er) {}\n }\n entry.resume()\n }\n\n [MKDIR] (dir, mode) {\n try {\n return mkdir.sync(dir, {\n uid: this.uid,\n gid: this.gid,\n processUid: this.processUid,\n processGid: this.processGid,\n umask: this.processUmask,\n preserve: this.preservePaths,\n unlink: this.unlink,\n cache: this.dirCache,\n cwd: this.cwd,\n mode: mode,\n })\n } catch (er) {\n return er\n }\n }\n\n [LINK] (entry, linkpath, link, _) {\n try {\n fs[link + 'Sync'](linkpath, entry.absolute)\n entry.resume()\n } catch (er) {\n return this[ONERROR](er, entry)\n }\n }\n}\n\nUnpack.Sync = UnpackSync\nmodule.exports = Unpack\n","'use strict'\n\n// tar -u\n\nconst hlo = require('./high-level-opt.js')\nconst r = require('./replace.js')\n// just call tar.r with the filter and mtimeCache\n\nmodule.exports = (opt_, files, cb) => {\n const opt = hlo(opt_)\n\n if (!opt.file)\n throw new TypeError('file is required')\n\n if (opt.gzip)\n throw new TypeError('cannot append to compressed archives')\n\n if (!files || !Array.isArray(files) || !files.length)\n throw new TypeError('no files or directories specified')\n\n files = Array.from(files)\n\n mtimeFilter(opt)\n return r(opt, files, cb)\n}\n\nconst mtimeFilter = opt => {\n const filter = opt.filter\n\n if (!opt.mtimeCache)\n opt.mtimeCache = new Map()\n\n opt.filter = filter ? (path, stat) =>\n filter(path, stat) && !(opt.mtimeCache.get(path) > stat.mtime)\n : (path, stat) => !(opt.mtimeCache.get(path) > stat.mtime)\n}\n","'use strict'\nmodule.exports = Base => class extends Base {\n warn (code, message, data = {}) {\n if (this.file)\n data.file = this.file\n if (this.cwd)\n data.cwd = this.cwd\n data.code = message instanceof Error && message.code || code\n data.tarCode = code\n if (!this.strict && data.recoverable !== false) {\n if (message instanceof Error) {\n data = Object.assign(message, data)\n message = message.message\n }\n this.emit('warn', data.tarCode, message, data)\n } else if (message instanceof Error)\n this.emit('error', Object.assign(message, data))\n else\n this.emit('error', Object.assign(new Error(`${code}: ${message}`), data))\n }\n}\n","'use strict'\n\n// When writing files on Windows, translate the characters to their\n// 0xf000 higher-encoded versions.\n\nconst raw = [\n '|',\n '<',\n '>',\n '?',\n ':',\n]\n\nconst win = raw.map(char =>\n String.fromCharCode(0xf000 + char.charCodeAt(0)))\n\nconst toWin = new Map(raw.map((char, i) => [char, win[i]]))\nconst toRaw = new Map(win.map((char, i) => [char, raw[i]]))\n\nmodule.exports = {\n encode: s => raw.reduce((s, c) => s.split(c).join(toWin.get(c)), s),\n decode: s => win.reduce((s, c) => s.split(c).join(toRaw.get(c)), s),\n}\n","'use strict'\nconst MiniPass = require('minipass')\nconst Pax = require('./pax.js')\nconst Header = require('./header.js')\nconst fs = require('fs')\nconst path = require('path')\n\nconst maxReadSize = 16 * 1024 * 1024\nconst PROCESS = Symbol('process')\nconst FILE = Symbol('file')\nconst DIRECTORY = Symbol('directory')\nconst SYMLINK = Symbol('symlink')\nconst HARDLINK = Symbol('hardlink')\nconst HEADER = Symbol('header')\nconst READ = Symbol('read')\nconst LSTAT = Symbol('lstat')\nconst ONLSTAT = Symbol('onlstat')\nconst ONREAD = Symbol('onread')\nconst ONREADLINK = Symbol('onreadlink')\nconst OPENFILE = Symbol('openfile')\nconst ONOPENFILE = Symbol('onopenfile')\nconst CLOSE = Symbol('close')\nconst MODE = Symbol('mode')\nconst warner = require('./warn-mixin.js')\nconst winchars = require('./winchars.js')\n\nconst modeFix = require('./mode-fix.js')\n\nconst WriteEntry = warner(class WriteEntry extends MiniPass {\n constructor (p, opt) {\n opt = opt || {}\n super(opt)\n if (typeof p !== 'string')\n throw new TypeError('path is required')\n this.path = p\n // suppress atime, ctime, uid, gid, uname, gname\n this.portable = !!opt.portable\n // until node has builtin pwnam functions, this'll have to do\n this.myuid = process.getuid && process.getuid()\n this.myuser = process.env.USER || ''\n this.maxReadSize = opt.maxReadSize || maxReadSize\n this.linkCache = opt.linkCache || new Map()\n this.statCache = opt.statCache || new Map()\n this.preservePaths = !!opt.preservePaths\n this.cwd = opt.cwd || process.cwd()\n this.strict = !!opt.strict\n this.noPax = !!opt.noPax\n this.noMtime = !!opt.noMtime\n this.mtime = opt.mtime || null\n\n if (typeof opt.onwarn === 'function')\n this.on('warn', opt.onwarn)\n\n let pathWarn = false\n if (!this.preservePaths && path.win32.isAbsolute(p)) {\n // absolutes on posix are also absolutes on win32\n // so we only need to test this one to get both\n const parsed = path.win32.parse(p)\n this.path = p.substr(parsed.root.length)\n pathWarn = parsed.root\n }\n\n this.win32 = !!opt.win32 || process.platform === 'win32'\n if (this.win32) {\n this.path = winchars.decode(this.path.replace(/\\\\/g, '/'))\n p = p.replace(/\\\\/g, '/')\n }\n\n this.absolute = opt.absolute || path.resolve(this.cwd, p)\n\n if (this.path === '')\n this.path = './'\n\n if (pathWarn) {\n this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, {\n entry: this,\n path: pathWarn + this.path,\n })\n }\n\n if (this.statCache.has(this.absolute))\n this[ONLSTAT](this.statCache.get(this.absolute))\n else\n this[LSTAT]()\n }\n\n [LSTAT] () {\n fs.lstat(this.absolute, (er, stat) => {\n if (er)\n return this.emit('error', er)\n this[ONLSTAT](stat)\n })\n }\n\n [ONLSTAT] (stat) {\n this.statCache.set(this.absolute, stat)\n this.stat = stat\n if (!stat.isFile())\n stat.size = 0\n this.type = getType(stat)\n this.emit('stat', stat)\n this[PROCESS]()\n }\n\n [PROCESS] () {\n switch (this.type) {\n case 'File': return this[FILE]()\n case 'Directory': return this[DIRECTORY]()\n case 'SymbolicLink': return this[SYMLINK]()\n // unsupported types are ignored.\n default: return this.end()\n }\n }\n\n [MODE] (mode) {\n return modeFix(mode, this.type === 'Directory', this.portable)\n }\n\n [HEADER] () {\n if (this.type === 'Directory' && this.portable)\n this.noMtime = true\n\n this.header = new Header({\n path: this.path,\n linkpath: this.linkpath,\n // only the permissions and setuid/setgid/sticky bitflags\n // not the higher-order bits that specify file type\n mode: this[MODE](this.stat.mode),\n uid: this.portable ? null : this.stat.uid,\n gid: this.portable ? null : this.stat.gid,\n size: this.stat.size,\n mtime: this.noMtime ? null : this.mtime || this.stat.mtime,\n type: this.type,\n uname: this.portable ? null :\n this.stat.uid === this.myuid ? this.myuser : '',\n atime: this.portable ? null : this.stat.atime,\n ctime: this.portable ? null : this.stat.ctime,\n })\n\n if (this.header.encode() && !this.noPax) {\n this.write(new Pax({\n atime: this.portable ? null : this.header.atime,\n ctime: this.portable ? null : this.header.ctime,\n gid: this.portable ? null : this.header.gid,\n mtime: this.noMtime ? null : this.mtime || this.header.mtime,\n path: this.path,\n linkpath: this.linkpath,\n size: this.header.size,\n uid: this.portable ? null : this.header.uid,\n uname: this.portable ? null : this.header.uname,\n dev: this.portable ? null : this.stat.dev,\n ino: this.portable ? null : this.stat.ino,\n nlink: this.portable ? null : this.stat.nlink,\n }).encode())\n }\n this.write(this.header.block)\n }\n\n [DIRECTORY] () {\n if (this.path.substr(-1) !== '/')\n this.path += '/'\n this.stat.size = 0\n this[HEADER]()\n this.end()\n }\n\n [SYMLINK] () {\n fs.readlink(this.absolute, (er, linkpath) => {\n if (er)\n return this.emit('error', er)\n this[ONREADLINK](linkpath)\n })\n }\n\n [ONREADLINK] (linkpath) {\n this.linkpath = linkpath.replace(/\\\\/g, '/')\n this[HEADER]()\n this.end()\n }\n\n [HARDLINK] (linkpath) {\n this.type = 'Link'\n this.linkpath = path.relative(this.cwd, linkpath).replace(/\\\\/g, '/')\n this.stat.size = 0\n this[HEADER]()\n this.end()\n }\n\n [FILE] () {\n if (this.stat.nlink > 1) {\n const linkKey = this.stat.dev + ':' + this.stat.ino\n if (this.linkCache.has(linkKey)) {\n const linkpath = this.linkCache.get(linkKey)\n if (linkpath.indexOf(this.cwd) === 0)\n return this[HARDLINK](linkpath)\n }\n this.linkCache.set(linkKey, this.absolute)\n }\n\n this[HEADER]()\n if (this.stat.size === 0)\n return this.end()\n\n this[OPENFILE]()\n }\n\n [OPENFILE] () {\n fs.open(this.absolute, 'r', (er, fd) => {\n if (er)\n return this.emit('error', er)\n this[ONOPENFILE](fd)\n })\n }\n\n [ONOPENFILE] (fd) {\n const blockLen = 512 * Math.ceil(this.stat.size / 512)\n const bufLen = Math.min(blockLen, this.maxReadSize)\n const buf = Buffer.allocUnsafe(bufLen)\n this[READ](fd, buf, 0, buf.length, 0, this.stat.size, blockLen)\n }\n\n [READ] (fd, buf, offset, length, pos, remain, blockRemain) {\n fs.read(fd, buf, offset, length, pos, (er, bytesRead) => {\n if (er) {\n // ignoring the error from close(2) is a bad practice, but at\n // this point we already have an error, don't need another one\n return this[CLOSE](fd, () => this.emit('error', er))\n }\n this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead)\n })\n }\n\n [CLOSE] (fd, cb) {\n fs.close(fd, cb)\n }\n\n [ONREAD] (fd, buf, offset, length, pos, remain, blockRemain, bytesRead) {\n if (bytesRead <= 0 && remain > 0) {\n const er = new Error('encountered unexpected EOF')\n er.path = this.absolute\n er.syscall = 'read'\n er.code = 'EOF'\n return this[CLOSE](fd, () => this.emit('error', er))\n }\n\n if (bytesRead > remain) {\n const er = new Error('did not encounter expected EOF')\n er.path = this.absolute\n er.syscall = 'read'\n er.code = 'EOF'\n return this[CLOSE](fd, () => this.emit('error', er))\n }\n\n // null out the rest of the buffer, if we could fit the block padding\n if (bytesRead === remain) {\n for (let i = bytesRead; i < length && bytesRead < blockRemain; i++) {\n buf[i + offset] = 0\n bytesRead++\n remain++\n }\n }\n\n const writeBuf = offset === 0 && bytesRead === buf.length ?\n buf : buf.slice(offset, offset + bytesRead)\n remain -= bytesRead\n blockRemain -= bytesRead\n pos += bytesRead\n offset += bytesRead\n\n this.write(writeBuf)\n\n if (!remain) {\n if (blockRemain)\n this.write(Buffer.alloc(blockRemain))\n return this[CLOSE](fd, er => er ? this.emit('error', er) : this.end())\n }\n\n if (offset >= length) {\n buf = Buffer.allocUnsafe(length)\n offset = 0\n }\n length = buf.length - offset\n this[READ](fd, buf, offset, length, pos, remain, blockRemain)\n }\n})\n\nclass WriteEntrySync extends WriteEntry {\n [LSTAT] () {\n this[ONLSTAT](fs.lstatSync(this.absolute))\n }\n\n [SYMLINK] () {\n this[ONREADLINK](fs.readlinkSync(this.absolute))\n }\n\n [OPENFILE] () {\n this[ONOPENFILE](fs.openSync(this.absolute, 'r'))\n }\n\n [READ] (fd, buf, offset, length, pos, remain, blockRemain) {\n let threw = true\n try {\n const bytesRead = fs.readSync(fd, buf, offset, length, pos)\n this[ONREAD](fd, buf, offset, length, pos, remain, blockRemain, bytesRead)\n threw = false\n } finally {\n // ignoring the error from close(2) is a bad practice, but at\n // this point we already have an error, don't need another one\n if (threw) {\n try {\n this[CLOSE](fd, () => {})\n } catch (er) {}\n }\n }\n }\n\n [CLOSE] (fd, cb) {\n fs.closeSync(fd)\n cb()\n }\n}\n\nconst WriteEntryTar = warner(class WriteEntryTar extends MiniPass {\n constructor (readEntry, opt) {\n opt = opt || {}\n super(opt)\n this.preservePaths = !!opt.preservePaths\n this.portable = !!opt.portable\n this.strict = !!opt.strict\n this.noPax = !!opt.noPax\n this.noMtime = !!opt.noMtime\n\n this.readEntry = readEntry\n this.type = readEntry.type\n if (this.type === 'Directory' && this.portable)\n this.noMtime = true\n\n this.path = readEntry.path\n this.mode = this[MODE](readEntry.mode)\n this.uid = this.portable ? null : readEntry.uid\n this.gid = this.portable ? null : readEntry.gid\n this.uname = this.portable ? null : readEntry.uname\n this.gname = this.portable ? null : readEntry.gname\n this.size = readEntry.size\n this.mtime = this.noMtime ? null : opt.mtime || readEntry.mtime\n this.atime = this.portable ? null : readEntry.atime\n this.ctime = this.portable ? null : readEntry.ctime\n this.linkpath = readEntry.linkpath\n\n if (typeof opt.onwarn === 'function')\n this.on('warn', opt.onwarn)\n\n let pathWarn = false\n if (path.isAbsolute(this.path) && !this.preservePaths) {\n const parsed = path.parse(this.path)\n pathWarn = parsed.root\n this.path = this.path.substr(parsed.root.length)\n }\n\n this.remain = readEntry.size\n this.blockRemain = readEntry.startBlockSize\n\n this.header = new Header({\n path: this.path,\n linkpath: this.linkpath,\n // only the permissions and setuid/setgid/sticky bitflags\n // not the higher-order bits that specify file type\n mode: this.mode,\n uid: this.portable ? null : this.uid,\n gid: this.portable ? null : this.gid,\n size: this.size,\n mtime: this.noMtime ? null : this.mtime,\n type: this.type,\n uname: this.portable ? null : this.uname,\n atime: this.portable ? null : this.atime,\n ctime: this.portable ? null : this.ctime,\n })\n\n if (pathWarn) {\n this.warn('TAR_ENTRY_INFO', `stripping ${pathWarn} from absolute path`, {\n entry: this,\n path: pathWarn + this.path,\n })\n }\n\n if (this.header.encode() && !this.noPax) {\n super.write(new Pax({\n atime: this.portable ? null : this.atime,\n ctime: this.portable ? null : this.ctime,\n gid: this.portable ? null : this.gid,\n mtime: this.noMtime ? null : this.mtime,\n path: this.path,\n linkpath: this.linkpath,\n size: this.size,\n uid: this.portable ? null : this.uid,\n uname: this.portable ? null : this.uname,\n dev: this.portable ? null : this.readEntry.dev,\n ino: this.portable ? null : this.readEntry.ino,\n nlink: this.portable ? null : this.readEntry.nlink,\n }).encode())\n }\n\n super.write(this.header.block)\n readEntry.pipe(this)\n }\n\n [MODE] (mode) {\n return modeFix(mode, this.type === 'Directory', this.portable)\n }\n\n write (data) {\n const writeLen = data.length\n if (writeLen > this.blockRemain)\n throw new Error('writing more to entry than is appropriate')\n this.blockRemain -= writeLen\n return super.write(data)\n }\n\n end () {\n if (this.blockRemain)\n this.write(Buffer.alloc(this.blockRemain))\n return super.end()\n }\n})\n\nWriteEntry.Sync = WriteEntrySync\nWriteEntry.Tar = WriteEntryTar\n\nconst getType = stat =>\n stat.isFile() ? 'File'\n : stat.isDirectory() ? 'Directory'\n : stat.isSymbolicLink() ? 'SymbolicLink'\n : 'Unsupported'\n\nmodule.exports = WriteEntry\n","'use strict'\nmodule.exports = function (Yallist) {\n Yallist.prototype[Symbol.iterator] = function* () {\n for (let walker = this.head; walker; walker = walker.next) {\n yield walker.value\n }\n }\n}\n","'use strict'\nmodule.exports = Yallist\n\nYallist.Node = Node\nYallist.create = Yallist\n\nfunction Yallist (list) {\n var self = this\n if (!(self instanceof Yallist)) {\n self = new Yallist()\n }\n\n self.tail = null\n self.head = null\n self.length = 0\n\n if (list && typeof list.forEach === 'function') {\n list.forEach(function (item) {\n self.push(item)\n })\n } else if (arguments.length > 0) {\n for (var i = 0, l = arguments.length; i < l; i++) {\n self.push(arguments[i])\n }\n }\n\n return self\n}\n\nYallist.prototype.removeNode = function (node) {\n if (node.list !== this) {\n throw new Error('removing node which does not belong to this list')\n }\n\n var next = node.next\n var prev = node.prev\n\n if (next) {\n next.prev = prev\n }\n\n if (prev) {\n prev.next = next\n }\n\n if (node === this.head) {\n this.head = next\n }\n if (node === this.tail) {\n this.tail = prev\n }\n\n node.list.length--\n node.next = null\n node.prev = null\n node.list = null\n\n return next\n}\n\nYallist.prototype.unshiftNode = function (node) {\n if (node === this.head) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var head = this.head\n node.list = this\n node.next = head\n if (head) {\n head.prev = node\n }\n\n this.head = node\n if (!this.tail) {\n this.tail = node\n }\n this.length++\n}\n\nYallist.prototype.pushNode = function (node) {\n if (node === this.tail) {\n return\n }\n\n if (node.list) {\n node.list.removeNode(node)\n }\n\n var tail = this.tail\n node.list = this\n node.prev = tail\n if (tail) {\n tail.next = node\n }\n\n this.tail = node\n if (!this.head) {\n this.head = node\n }\n this.length++\n}\n\nYallist.prototype.push = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n push(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.unshift = function () {\n for (var i = 0, l = arguments.length; i < l; i++) {\n unshift(this, arguments[i])\n }\n return this.length\n}\n\nYallist.prototype.pop = function () {\n if (!this.tail) {\n return undefined\n }\n\n var res = this.tail.value\n this.tail = this.tail.prev\n if (this.tail) {\n this.tail.next = null\n } else {\n this.head = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.shift = function () {\n if (!this.head) {\n return undefined\n }\n\n var res = this.head.value\n this.head = this.head.next\n if (this.head) {\n this.head.prev = null\n } else {\n this.tail = null\n }\n this.length--\n return res\n}\n\nYallist.prototype.forEach = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.head, i = 0; walker !== null; i++) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.next\n }\n}\n\nYallist.prototype.forEachReverse = function (fn, thisp) {\n thisp = thisp || this\n for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {\n fn.call(thisp, walker.value, i, this)\n walker = walker.prev\n }\n}\n\nYallist.prototype.get = function (n) {\n for (var i = 0, walker = this.head; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.next\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.getReverse = function (n) {\n for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {\n // abort out of the list early if we hit a cycle\n walker = walker.prev\n }\n if (i === n && walker !== null) {\n return walker.value\n }\n}\n\nYallist.prototype.map = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.head; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.next\n }\n return res\n}\n\nYallist.prototype.mapReverse = function (fn, thisp) {\n thisp = thisp || this\n var res = new Yallist()\n for (var walker = this.tail; walker !== null;) {\n res.push(fn.call(thisp, walker.value, this))\n walker = walker.prev\n }\n return res\n}\n\nYallist.prototype.reduce = function (fn, initial) {\n var acc\n var walker = this.head\n if (arguments.length > 1) {\n acc = initial\n } else if (this.head) {\n walker = this.head.next\n acc = this.head.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = 0; walker !== null; i++) {\n acc = fn(acc, walker.value, i)\n walker = walker.next\n }\n\n return acc\n}\n\nYallist.prototype.reduceReverse = function (fn, initial) {\n var acc\n var walker = this.tail\n if (arguments.length > 1) {\n acc = initial\n } else if (this.tail) {\n walker = this.tail.prev\n acc = this.tail.value\n } else {\n throw new TypeError('Reduce of empty list with no initial value')\n }\n\n for (var i = this.length - 1; walker !== null; i--) {\n acc = fn(acc, walker.value, i)\n walker = walker.prev\n }\n\n return acc\n}\n\nYallist.prototype.toArray = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.head; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.next\n }\n return arr\n}\n\nYallist.prototype.toArrayReverse = function () {\n var arr = new Array(this.length)\n for (var i = 0, walker = this.tail; walker !== null; i++) {\n arr[i] = walker.value\n walker = walker.prev\n }\n return arr\n}\n\nYallist.prototype.slice = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = 0, walker = this.head; walker !== null && i < from; i++) {\n walker = walker.next\n }\n for (; walker !== null && i < to; i++, walker = walker.next) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.sliceReverse = function (from, to) {\n to = to || this.length\n if (to < 0) {\n to += this.length\n }\n from = from || 0\n if (from < 0) {\n from += this.length\n }\n var ret = new Yallist()\n if (to < from || to < 0) {\n return ret\n }\n if (from < 0) {\n from = 0\n }\n if (to > this.length) {\n to = this.length\n }\n for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {\n walker = walker.prev\n }\n for (; walker !== null && i > from; i--, walker = walker.prev) {\n ret.push(walker.value)\n }\n return ret\n}\n\nYallist.prototype.splice = function (start, deleteCount, ...nodes) {\n if (start > this.length) {\n start = this.length - 1\n }\n if (start < 0) {\n start = this.length + start;\n }\n\n for (var i = 0, walker = this.head; walker !== null && i < start; i++) {\n walker = walker.next\n }\n\n var ret = []\n for (var i = 0; walker && i < deleteCount; i++) {\n ret.push(walker.value)\n walker = this.removeNode(walker)\n }\n if (walker === null) {\n walker = this.tail\n }\n\n if (walker !== this.head && walker !== this.tail) {\n walker = walker.prev\n }\n\n for (var i = 0; i < nodes.length; i++) {\n walker = insert(this, walker, nodes[i])\n }\n return ret;\n}\n\nYallist.prototype.reverse = function () {\n var head = this.head\n var tail = this.tail\n for (var walker = head; walker !== null; walker = walker.prev) {\n var p = walker.prev\n walker.prev = walker.next\n walker.next = p\n }\n this.head = tail\n this.tail = head\n return this\n}\n\nfunction insert (self, node, value) {\n var inserted = node === self.head ?\n new Node(value, null, node, self) :\n new Node(value, node, node.next, self)\n\n if (inserted.next === null) {\n self.tail = inserted\n }\n if (inserted.prev === null) {\n self.head = inserted\n }\n\n self.length++\n\n return inserted\n}\n\nfunction push (self, item) {\n self.tail = new Node(item, self.tail, null, self)\n if (!self.head) {\n self.head = self.tail\n }\n self.length++\n}\n\nfunction unshift (self, item) {\n self.head = new Node(item, null, self.head, self)\n if (!self.tail) {\n self.tail = self.head\n }\n self.length++\n}\n\nfunction Node (value, prev, next, list) {\n if (!(this instanceof Node)) {\n return new Node(value, prev, next, list)\n }\n\n this.list = list\n this.value = value\n\n if (prev) {\n prev.next = this\n this.prev = prev\n } else {\n this.prev = null\n }\n\n if (next) {\n next.prev = this\n this.next = next\n } else {\n this.next = null\n }\n}\n\ntry {\n // add if support for Symbol.iterator is present\n require('./iterator.js')(Yallist)\n} catch (er) {}\n","export const TOKEN_REF = '$jsii.byref';\nexport const TOKEN_INTERFACES = '$jsii.interfaces';\nexport const TOKEN_DATE = '$jsii.date';\nexport const TOKEN_ENUM = '$jsii.enum';\nexport const TOKEN_MAP = '$jsii.map';\nexport const TOKEN_STRUCT = '$jsii.struct';\n\nexport interface ObjRef {\n readonly [TOKEN_REF]: string;\n}\n\nexport interface AnnotatedObjRef extends ObjRef {\n [TOKEN_INTERFACES]?: readonly string[];\n}\n\nexport function isObjRef(value: any): value is ObjRef {\n return typeof value === 'object' && value !== null && TOKEN_REF in value;\n}\n\nexport interface WireDate {\n readonly [TOKEN_DATE]: string;\n}\n\nexport function isWireDate(value: any): value is WireDate {\n return typeof value === 'object' && value !== null && TOKEN_DATE in value;\n}\n\nexport interface WireEnum {\n readonly [TOKEN_ENUM]: string;\n}\n\nexport function isWireEnum(value: any): value is WireEnum {\n return typeof value === 'object' && value !== null && TOKEN_ENUM in value;\n}\n\nexport interface WireMap {\n readonly [TOKEN_MAP]: { readonly [key: string]: any };\n}\n\nexport function isWireMap(value: any): value is WireMap {\n return typeof value === 'object' && value !== null && TOKEN_MAP in value;\n}\n\nexport interface WireStruct {\n readonly [TOKEN_STRUCT]: {\n readonly fqn: string;\n readonly data: { [key: string]: any };\n };\n}\n\nexport function isWireStruct(value: any): value is WireStruct {\n return typeof value === 'object' && value !== null && TOKEN_STRUCT in value;\n}\n\nexport type Override = MethodOverride | PropertyOverride;\n\nexport interface MethodOverride {\n readonly method: string;\n readonly cookie?: string;\n}\n\nexport function isMethodOverride(value: Override): value is MethodOverride {\n return (value as any).method != null; // Python passes \"null\"\n}\n\nexport interface PropertyOverride {\n readonly property: string;\n readonly cookie?: string;\n}\n\nexport function isPropertyOverride(value: Override): value is PropertyOverride {\n return (value as any).property != null; // Python passes \"null\"\n}\n\nexport interface Callback {\n readonly cbid: string;\n readonly cookie: string | undefined;\n readonly invoke?: InvokeRequest;\n readonly get?: GetRequest;\n readonly set?: SetRequest;\n}\n\nexport interface HelloResponse {\n readonly hello: string;\n}\n\nexport interface LoadRequest {\n /** The name of the assembly */\n readonly name: string;\n\n /** Assembly version */\n readonly version: string;\n\n /** The tarball of the package */\n readonly tarball: string;\n}\n\nexport interface LoadResponse {\n readonly assembly: string;\n readonly types: number;\n}\n\nexport interface InvokeScriptRequest {\n readonly assembly: string;\n readonly script: string;\n readonly args?: string[];\n}\n\nexport interface InvokeScriptResponse {\n readonly status: number | null;\n readonly stdout: Buffer;\n readonly stderr: Buffer;\n readonly signal: string | null;\n}\n\nexport interface CreateRequest {\n /**\n * The FQN of the class of which an instance is requested (or \"Object\")\n */\n readonly fqn: string;\n\n /**\n * The FQNs of interfaces the instance implements, if any. Declaring\n * interfaces that the class denoted by `fqn` implements is not necessary.\n * This means that memebers of interfaces found in this property should\n * declare members that are found in the `overrides` property.\n */\n readonly interfaces?: string[];\n\n /**\n * Arguments to pass to the constructor of `fqn`. (\"Object\" accepts none)\n */\n readonly args?: any[];\n\n /**\n * Declarations of method overrides that should trigger callbacks\n */\n readonly overrides?: Override[];\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CreateResponse extends AnnotatedObjRef {}\n\nexport interface DelRequest {\n readonly objref: ObjRef;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface DelResponse {}\n\nexport interface GetRequest {\n readonly objref: ObjRef;\n readonly property: string;\n}\n\nexport interface StaticGetRequest {\n readonly fqn: string;\n readonly property: string;\n}\n\nexport interface GetResponse {\n readonly value: any;\n}\n\nexport interface StaticSetRequest {\n readonly fqn: string;\n readonly property: string;\n readonly value: any;\n}\n\nexport interface SetRequest {\n readonly objref: ObjRef;\n readonly property: string;\n readonly value: any;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface SetResponse {}\n\nexport interface StaticInvokeRequest {\n readonly fqn: string;\n readonly method: string;\n readonly args?: any[];\n}\n\nexport interface InvokeRequest {\n readonly objref: ObjRef;\n readonly method: string;\n readonly args?: any[];\n}\n\nexport interface InvokeResponse {\n readonly result: any;\n}\n\nexport interface BeginRequest {\n readonly objref: ObjRef;\n readonly method: string;\n readonly args?: any[];\n}\n\nexport interface BeginResponse {\n readonly promiseid: string;\n}\n\nexport interface EndRequest {\n readonly promiseid: string;\n}\n\nexport interface EndResponse {\n readonly result: any;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface CallbacksRequest {}\n\nexport interface CallbacksResponse {\n readonly callbacks: Callback[];\n}\n\nexport interface CompleteRequest {\n readonly cbid: string;\n readonly err?: string;\n readonly result?: any;\n}\n\nexport interface CompleteResponse {\n readonly cbid: string;\n}\n\nexport interface NamingRequest {\n readonly assembly: string;\n}\n\nexport interface NamingResponse {\n readonly naming: {\n readonly [language: string]: { readonly [key: string]: any } | undefined;\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface StatsRequest {}\n\nexport interface StatsResponse {\n readonly objectCount: number;\n}\n\nexport type KernelRequest =\n | LoadRequest\n | CreateRequest\n | DelRequest\n | GetRequest\n | SetRequest\n | InvokeRequest\n | BeginRequest\n | EndRequest\n | CallbacksRequest\n | CompleteRequest\n | NamingRequest\n | StatsRequest;\n\nexport type KernelResponse =\n | HelloResponse\n | LoadResponse\n | CreateResponse\n | DelResponse\n | GetResponse\n | SetResponse\n | InvokeResponse\n | BeginResponse\n | EndResponse\n | CallbacksResponse\n | CompleteResponse\n | NamingResponse\n | StatsResponse;\n\nexport interface OkayResponse {\n readonly ok: any;\n}\n\nexport interface ErrorResponse {\n readonly error: string;\n readonly stack?: string;\n}\n","export * from './kernel';\n\nimport * as api from './api';\nexport { api };\n","import * as spec from '@jsii/spec';\nimport * as cp from 'child_process';\nimport * as fs from 'fs-extra';\nimport * as os from 'os';\nimport * as path from 'path';\nimport * as tar from 'tar';\nimport * as vm from 'vm';\n\nimport * as api from './api';\nimport { TOKEN_REF } from './api';\nimport { ObjectTable, tagJsiiConstructor } from './objects';\nimport * as onExit from './on-exit';\nimport * as wire from './serialization';\n\nexport class Kernel {\n /**\n * Set to true for verbose debugging.\n */\n public traceEnabled = false;\n\n private assemblies: { [name: string]: Assembly } = {};\n private readonly objects = new ObjectTable(this._typeInfoForFqn.bind(this));\n private cbs: { [cbid: string]: Callback } = {};\n private waiting: { [cbid: string]: Callback } = {};\n private promises: { [prid: string]: AsyncInvocation } = {};\n private nextid = 20000; // incrementing counter for objid, cbid, promiseid\n private syncInProgress?: string; // forbids async calls (begin) while processing sync calls (get/set/invoke)\n private installDir?: string;\n\n private readonly sandbox: vm.Context;\n\n /**\n * Creates a jsii kernel object.\n *\n * @param callbackHandler This handler is invoked when a synchronous callback is called.\n * It's responsibility is to execute the callback and return it's\n * result (or throw an error).\n */\n public constructor(public callbackHandler: (callback: api.Callback) => any) {\n // `setImmediate` is required for tests to pass (it is otherwise\n // impossible to wait for in-VM promises to complete)\n\n // `Buffer` is required when using simple-resource-bundler.\n\n // HACK: when we webpack @jsii/runtime, all \"require\" statements get transpiled,\n // so modules can be resolved within the pack. However, here we actually want to\n // let loaded modules to use the native node \"require\" method.\n // I wonder if webpack has some pragma that allows opting-out at certain points\n // in the code.\n // eslint-disable-next-line @typescript-eslint/no-require-imports,@typescript-eslint/no-var-requires\n const moduleLoad = require('module').Module._load;\n const nodeRequire = (p: string) => moduleLoad(p, module, false);\n\n this.sandbox = vm.createContext({\n Buffer, // to use simple-resource-bundler\n setImmediate, // async tests\n require: nodeRequire, // modules need to \"require\"\n });\n }\n\n public load(req: api.LoadRequest): api.LoadResponse {\n this._debug('load', req);\n\n if ('assembly' in req) {\n throw new Error(\n '`assembly` field is deprecated for \"load\", use `name`, `version` and `tarball` instead',\n );\n }\n\n const pkgname = req.name;\n const pkgver = req.version;\n\n // check if we already have such a module\n const packageDir = this._getPackageDir(pkgname);\n if (fs.pathExistsSync(packageDir)) {\n // module exists, verify version\n const epkg = fs.readJsonSync(path.join(packageDir, 'package.json'));\n if (epkg.version !== pkgver) {\n throw new Error(\n `Multiple versions ${pkgver} and ${epkg.version} of the ` +\n `package '${pkgname}' cannot be loaded together since this is unsupported by ` +\n 'some runtime environments',\n );\n }\n\n // same version, no-op\n this._debug('look up already-loaded assembly', pkgname);\n const assm = this.assemblies[pkgname];\n\n return {\n assembly: assm.metadata.name,\n types: Object.keys(assm.metadata.types ?? {}).length,\n };\n }\n\n // Create the install directory (there may be several path components for @scoped/packages)\n fs.mkdirpSync(packageDir);\n\n // Force umask to have npm-install-like permissions\n const originalUmask = process.umask(0o022);\n try {\n // untar the archive to its final location\n tar.extract({\n cwd: packageDir,\n file: req.tarball,\n strict: true,\n strip: 1, // Removes the 'package/' path element from entries\n sync: true,\n unlink: true,\n });\n } finally {\n // Reset umask to the initial value\n process.umask(originalUmask);\n }\n\n // read .jsii metadata from the root of the package\n const jsiiMetadataFile = path.join(packageDir, spec.SPEC_FILE_NAME);\n if (!fs.pathExistsSync(jsiiMetadataFile)) {\n throw new Error(\n `Package tarball ${req.tarball} must have a file named ${spec.SPEC_FILE_NAME} at the root`,\n );\n }\n const assmSpec = fs.readJsonSync(jsiiMetadataFile) as spec.Assembly;\n\n // load the module and capture it's closure\n const closure = this._execute(\n `require(String.raw\\`${packageDir}\\`)`,\n packageDir,\n );\n const assm = new Assembly(assmSpec, closure);\n this._addAssembly(assm);\n\n return {\n assembly: assmSpec.name,\n types: Object.keys(assmSpec.types ?? {}).length,\n };\n }\n\n public invokeBinScript(\n req: api.InvokeScriptRequest,\n ): api.InvokeScriptResponse {\n const packageDir = this._getPackageDir(req.assembly);\n if (fs.pathExistsSync(packageDir)) {\n // module exists, verify version\n const epkg = fs.readJsonSync(path.join(packageDir, 'package.json'));\n\n if (!epkg.bin) {\n throw new Error('There is no bin scripts defined for this package.');\n }\n\n const scriptPath = epkg.bin[req.script];\n\n if (!epkg.bin) {\n throw new Error(`Script with name ${req.script} was not defined.`);\n }\n\n const result = cp.spawnSync(\n path.join(packageDir, scriptPath),\n req.args ?? [],\n {\n encoding: 'utf-8',\n env: {\n ...process.env,\n // Make sure the current NODE_OPTIONS are honored if we shell out to node\n NODE_OPTIONS: process.execArgv.join(' '),\n // Make sure \"this\" node is ahead of $PATH just in case\n PATH: `${path.dirname(process.execPath)}:${process.env.PATH}`,\n },\n shell: true,\n },\n );\n\n return {\n stdout: result.stdout,\n stderr: result.stderr,\n status: result.status,\n signal: result.signal,\n };\n }\n throw new Error(`Package with name ${req.assembly} was not loaded.`);\n }\n\n public create(req: api.CreateRequest): api.CreateResponse {\n return this._create(req);\n }\n\n public del(req: api.DelRequest): api.DelResponse {\n const { objref } = req;\n\n this._debug('del', objref);\n this.objects.deleteObject(objref);\n\n return {};\n }\n\n public sget(req: api.StaticGetRequest): api.GetResponse {\n const { fqn, property } = req;\n const symbol = `${fqn}.${property}`;\n this._debug('sget', symbol);\n const ti = this._typeInfoForProperty(property, fqn);\n\n if (!ti.static) {\n throw new Error(`property ${symbol} is not static`);\n }\n\n const prototype = this._findSymbol(fqn);\n\n const value = this._ensureSync(`property ${property}`, () =>\n this._wrapSandboxCode(() => prototype[property]),\n );\n\n this._debug('value:', value);\n const ret = this._fromSandbox(value, ti);\n this._debug('ret', ret);\n return { value: ret };\n }\n\n public sset(req: api.StaticSetRequest): api.SetResponse {\n const { fqn, property, value } = req;\n const symbol = `${fqn}.${property}`;\n this._debug('sset', symbol);\n const ti = this._typeInfoForProperty(property, fqn);\n\n if (!ti.static) {\n throw new Error(`property ${symbol} is not static`);\n }\n\n if (ti.immutable) {\n throw new Error(`static property ${symbol} is readonly`);\n }\n\n const prototype = this._findSymbol(fqn);\n\n this._ensureSync(`property ${property}`, () =>\n this._wrapSandboxCode(\n () => (prototype[property] = this._toSandbox(value, ti)),\n ),\n );\n\n return {};\n }\n\n public get(req: api.GetRequest): api.GetResponse {\n const { objref, property } = req;\n this._debug('get', objref, property);\n const { instance, fqn, interfaces } = this.objects.findObject(objref);\n const ti = this._typeInfoForProperty(property, fqn, interfaces);\n\n // if the property is overridden by the native code and \"get\" is called on the object, it\n // means that the native code is trying to access the \"super\" property. in order to enable\n // that, we actually keep a copy of the original property descriptor when we override,\n // so `findPropertyTarget` will return either the original property name (\"property\") or\n // the \"super\" property name (somehing like \"$jsii$super$$\").\n const propertyToGet = this._findPropertyTarget(instance, property);\n\n // make the actual \"get\", and block any async calls that might be performed\n // by jsii overrides.\n const value = this._ensureSync(\n `property '${objref[TOKEN_REF]}.${propertyToGet}'`,\n () => this._wrapSandboxCode(() => instance[propertyToGet]),\n );\n this._debug('value:', value);\n const ret = this._fromSandbox(value, ti);\n this._debug('ret:', ret);\n return { value: ret };\n }\n\n public set(req: api.SetRequest): api.SetResponse {\n const { objref, property, value } = req;\n this._debug('set', objref, property, value);\n const { instance, fqn, interfaces } = this.objects.findObject(objref);\n\n const propInfo = this._typeInfoForProperty(req.property, fqn, interfaces);\n\n if (propInfo.immutable) {\n throw new Error(\n `Cannot set value of immutable property ${req.property} to ${req.value}`,\n );\n }\n\n const propertyToSet = this._findPropertyTarget(instance, property);\n\n this._ensureSync(`property '${objref[TOKEN_REF]}.${propertyToSet}'`, () =>\n this._wrapSandboxCode(\n () => (instance[propertyToSet] = this._toSandbox(value, propInfo)),\n ),\n );\n\n return {};\n }\n\n public invoke(req: api.InvokeRequest): api.InvokeResponse {\n const { objref, method } = req;\n const args = req.args ?? [];\n\n this._debug('invoke', objref, method, args);\n const { ti, obj, fn } = this._findInvokeTarget(objref, method, args);\n\n // verify this is not an async method\n if (ti.async) {\n throw new Error(`${method} is an async method, use \"begin\" instead`);\n }\n\n const ret = this._ensureSync(\n `method '${objref[TOKEN_REF]}.${method}'`,\n () => {\n return this._wrapSandboxCode(() =>\n fn.apply(obj, this._toSandboxValues(args, ti.parameters)),\n );\n },\n );\n\n const result = this._fromSandbox(ret, ti.returns ?? 'void');\n this._debug('invoke result', result);\n\n return { result };\n }\n\n public sinvoke(req: api.StaticInvokeRequest): api.InvokeResponse {\n const { fqn, method } = req;\n const args = req.args ?? [];\n\n this._debug('sinvoke', fqn, method, args);\n\n const ti = this._typeInfoForMethod(method, fqn);\n\n if (!ti.static) {\n throw new Error(`${fqn}.${method} is not a static method`);\n }\n\n // verify this is not an async method\n if (ti.async) {\n throw new Error(`${method} is an async method, use \"begin\" instead`);\n }\n\n const prototype = this._findSymbol(fqn);\n const fn = prototype[method] as (...params: any[]) => any;\n\n const ret = this._ensureSync(`method '${fqn}.${method}'`, () => {\n return this._wrapSandboxCode(() =>\n fn.apply(prototype, this._toSandboxValues(args, ti.parameters)),\n );\n });\n\n this._debug('method returned:', ret);\n return { result: this._fromSandbox(ret, ti.returns ?? 'void') };\n }\n\n public begin(req: api.BeginRequest): api.BeginResponse {\n const { objref, method } = req;\n const args = req.args ?? [];\n\n this._debug('begin', objref, method, args);\n\n if (this.syncInProgress) {\n throw new Error(\n `Cannot invoke async method '${req.objref[TOKEN_REF]}.${req.method}' while sync ${this.syncInProgress} is being processed`,\n );\n }\n\n const { ti, obj, fn } = this._findInvokeTarget(objref, method, args);\n\n // verify this is indeed an async method\n if (!ti.async) {\n throw new Error(`Method ${method} is expected to be an async method`);\n }\n\n const promise = this._wrapSandboxCode(() =>\n fn.apply(obj, this._toSandboxValues(args, ti.parameters)),\n ) as Promise;\n\n // since we are planning to resolve this promise in a different scope\n // we need to handle rejections here [1]\n // [1]: https://stackoverflow.com/questions/40920179/should-i-refrain-from-handling-promise-rejection-asynchronously/40921505\n promise.catch((_) => undefined);\n\n const prid = this._makeprid();\n this.promises[prid] = {\n promise,\n method: ti,\n };\n\n return { promiseid: prid };\n }\n\n public async end(req: api.EndRequest): Promise {\n const { promiseid } = req;\n\n this._debug('end', promiseid);\n\n const { promise, method } = this.promises[promiseid];\n if (promise == null) {\n throw new Error(`Cannot find promise with ID: ${promiseid}`);\n }\n\n let result;\n try {\n result = await promise;\n this._debug('promise result:', result);\n } catch (e) {\n this._debug('promise error:', e);\n throw e;\n }\n\n return { result: this._fromSandbox(result, method.returns ?? 'void') };\n }\n\n public callbacks(_req?: api.CallbacksRequest): api.CallbacksResponse {\n this._debug('callbacks');\n const ret = Object.keys(this.cbs).map((cbid) => {\n const cb = this.cbs[cbid];\n this.waiting[cbid] = cb; // move to waiting\n const callback: api.Callback = {\n cbid,\n cookie: cb.override.cookie,\n invoke: {\n objref: cb.objref,\n method: cb.override.method,\n args: cb.args,\n },\n };\n return callback;\n });\n\n // move all callbacks to the wait queue and clean the callback queue.\n this.cbs = {};\n return { callbacks: ret };\n }\n\n public complete(req: api.CompleteRequest): api.CompleteResponse {\n const { cbid, err, result } = req;\n\n this._debug('complete', cbid, err, result);\n\n if (!(cbid in this.waiting)) {\n throw new Error(`Callback ${cbid} not found`);\n }\n\n const cb = this.waiting[cbid];\n if (err) {\n this._debug('completed with error:', err);\n cb.fail(new Error(err));\n } else {\n const sandoxResult = this._toSandbox(\n result,\n cb.expectedReturnType ?? 'void',\n );\n this._debug('completed with result:', sandoxResult);\n cb.succeed(sandoxResult);\n }\n\n delete this.waiting[cbid];\n\n return { cbid };\n }\n\n /**\n * Returns the language-specific names for a jsii module.\n * @param assemblyName The name of the jsii module (i.e. jsii$jsii_calculator_lib$)\n */\n public naming(req: api.NamingRequest): api.NamingResponse {\n const assemblyName = req.assembly;\n\n this._debug('naming', assemblyName);\n\n const assembly = this._assemblyFor(assemblyName);\n const targets = assembly.metadata.targets;\n if (!targets) {\n throw new Error(`Unexpected - \"targets\" for ${assemblyName} is missing!`);\n }\n\n return { naming: targets };\n }\n\n public stats(_req?: api.StatsRequest): api.StatsResponse {\n return {\n objectCount: this.objects.count,\n };\n }\n\n private _addAssembly(assm: Assembly) {\n this.assemblies[assm.metadata.name] = assm;\n\n // add the __jsii__.fqn property on every constructor. this allows\n // traversing between the javascript and jsii worlds given any object.\n for (const fqn of Object.keys(assm.metadata.types ?? {})) {\n const typedef = assm.metadata.types![fqn];\n switch (typedef.kind) {\n case spec.TypeKind.Interface:\n continue; // interfaces don't really exist\n case spec.TypeKind.Class:\n case spec.TypeKind.Enum:\n const constructor = this._findSymbol(fqn);\n tagJsiiConstructor(constructor, fqn);\n }\n }\n }\n\n // find the javascript constructor function for a jsii FQN.\n private _findCtor(\n fqn: string,\n args: any[],\n ): { ctor: any; parameters?: spec.Parameter[] } {\n if (fqn === wire.EMPTY_OBJECT_FQN) {\n return { ctor: Object };\n }\n\n const typeinfo = this._typeInfoForFqn(fqn);\n\n switch (typeinfo.kind) {\n case spec.TypeKind.Class:\n const classType = typeinfo as spec.ClassType;\n this._validateMethodArguments(classType.initializer, args);\n return {\n ctor: this._findSymbol(fqn),\n parameters: classType.initializer && classType.initializer.parameters,\n };\n\n case spec.TypeKind.Interface:\n throw new Error(\n `Cannot create an object with an FQN of an interface: ${fqn}`,\n );\n\n default:\n throw new Error(`Unexpected FQN kind: ${fqn}`);\n }\n }\n\n private _getPackageDir(pkgname: string): string {\n if (!this.installDir) {\n this.installDir = fs.mkdtempSync(path.join(os.tmpdir(), 'jsii-kernel-'));\n fs.mkdirpSync(path.join(this.installDir, 'node_modules'));\n this._debug('creating jsii-kernel modules workdir:', this.installDir);\n\n onExit.removeSync(this.installDir);\n }\n return path.join(this.installDir, 'node_modules', pkgname);\n }\n\n // prefixed with _ to allow calling this method internally without\n // getting it recorded for testing.\n private _create(req: api.CreateRequest): api.CreateResponse {\n this._debug('create', req);\n const { fqn, interfaces, overrides } = req;\n\n const requestArgs = req.args ?? [];\n\n const ctorResult = this._findCtor(fqn, requestArgs);\n const ctor = ctorResult.ctor;\n const obj = this._wrapSandboxCode(\n () =>\n new ctor(...this._toSandboxValues(requestArgs, ctorResult.parameters)),\n );\n const objref = this.objects.registerObject(obj, fqn, req.interfaces ?? []);\n\n // overrides: for each one of the override method names, installs a\n // method on the newly created object which represents the remote \"reverse proxy\".\n\n if (overrides) {\n this._debug('overrides', overrides);\n\n const overrideTypeErrorMessage =\n 'Override can either be \"method\" or \"property\"';\n const methods = new Set();\n const properties = new Set();\n\n for (const override of overrides) {\n if (api.isMethodOverride(override)) {\n if (api.isPropertyOverride(override)) {\n throw new Error(overrideTypeErrorMessage);\n }\n if (methods.has(override.method)) {\n throw new Error(\n `Duplicate override for method '${override.method}'`,\n );\n }\n methods.add(override.method);\n\n this._applyMethodOverride(obj, objref, fqn, interfaces, override);\n } else if (api.isPropertyOverride(override)) {\n if (api.isMethodOverride(override)) {\n throw new Error(overrideTypeErrorMessage);\n }\n if (properties.has(override.property)) {\n throw Error(\n `Duplicate override for property '${override.property}'`,\n );\n }\n properties.add(override.property);\n\n this._applyPropertyOverride(obj, objref, fqn, interfaces, override);\n } else {\n throw new Error(overrideTypeErrorMessage);\n }\n }\n }\n\n return objref;\n }\n\n private _getSuperPropertyName(name: string) {\n return `$jsii$super$${name}$`;\n }\n\n private _applyPropertyOverride(\n obj: any,\n objref: api.ObjRef,\n typeFqn: string,\n interfaces: string[] | undefined,\n override: api.PropertyOverride,\n ) {\n // error if we can find a method with this name\n if (this._tryTypeInfoForMethod(override.property, typeFqn, interfaces)) {\n throw new Error(\n `Trying to override method '${override.property}' as a property`,\n );\n }\n\n let propInfo = this._tryTypeInfoForProperty(\n override.property,\n typeFqn,\n interfaces,\n );\n // if this is a private property (i.e. doesn't have `propInfo` the object has a key)\n if (!propInfo && override.property in obj) {\n this._debug(`Skipping override of private property ${override.property}`);\n return;\n }\n\n if (!propInfo) {\n // We've overriding a property on an object we have NO type information on (probably\n // because it's an anonymous object).\n // Pretend it's 'prop: any';\n //\n // FIXME: We could do better type checking during the conversion if JSII clients\n // would tell us the intended interface type.\n propInfo = {\n name: override.property,\n type: spec.CANONICAL_ANY,\n };\n }\n\n this._defineOverridenProperty(obj, objref, override, propInfo);\n }\n\n private _defineOverridenProperty(\n obj: any,\n objref: api.ObjRef,\n override: api.PropertyOverride,\n propInfo: spec.Property,\n ) {\n const propertyName = override.property;\n\n this._debug('apply override', propertyName);\n\n // save the old property under $jsii$super$$ so that property overrides\n // can still access it via `super.`.\n const prev = getPropertyDescriptor(obj, propertyName) ?? {\n value: obj[propertyName],\n writable: true,\n enumerable: true,\n configurable: true,\n };\n\n const prevEnumerable = prev.enumerable;\n prev.enumerable = false;\n Object.defineProperty(obj, this._getSuperPropertyName(propertyName), prev);\n\n // we add callbacks for both 'get' and 'set', even if the property\n // is readonly. this is fine because if you try to set() a readonly\n // property, it will fail.\n Object.defineProperty(obj, propertyName, {\n enumerable: prevEnumerable,\n configurable: prev.configurable,\n get: () => {\n this._debug('virtual get', objref, propertyName, {\n cookie: override.cookie,\n });\n const result = this.callbackHandler({\n cookie: override.cookie,\n cbid: this._makecbid(),\n get: { objref, property: propertyName },\n });\n this._debug('callback returned', result);\n return this._toSandbox(result, propInfo);\n },\n set: (value: any) => {\n this._debug('virtual set', objref, propertyName, {\n cookie: override.cookie,\n });\n this.callbackHandler({\n cookie: override.cookie,\n cbid: this._makecbid(),\n set: {\n objref,\n property: propertyName,\n value: this._fromSandbox(value, propInfo),\n },\n });\n },\n });\n\n function getPropertyDescriptor(\n obj: any,\n propertyName: string,\n ): PropertyDescriptor | undefined {\n const direct = Object.getOwnPropertyDescriptor(obj, propertyName);\n if (direct != null) {\n return direct;\n }\n const proto = Object.getPrototypeOf(obj);\n if (proto == null && proto !== Object.prototype) {\n // We reached Object or the prototype chain root, all hope is lost!\n return undefined;\n }\n return getPropertyDescriptor(proto, propertyName);\n }\n }\n\n private _applyMethodOverride(\n obj: any,\n objref: api.ObjRef,\n typeFqn: string,\n interfaces: string[] | undefined,\n override: api.MethodOverride,\n ) {\n // error if we can find a property with this name\n if (this._tryTypeInfoForProperty(override.method, typeFqn, interfaces)) {\n throw new Error(\n `Trying to override property '${override.method}' as a method`,\n );\n }\n\n let methodInfo = this._tryTypeInfoForMethod(\n override.method,\n typeFqn,\n interfaces,\n );\n\n // If this is a private method (doesn't have methodInfo, key resolves on the object), we\n // are going to skip the override.\n if (!methodInfo && obj[override.method]) {\n this._debug(`Skipping override of private method ${override.method}`);\n return;\n }\n\n if (!methodInfo) {\n // We've overriding a method on an object we have NO type information on (probably\n // because it's an anonymous object).\n // Pretend it's an (...args: any[]) => any\n methodInfo = {\n name: override.method,\n returns: { type: spec.CANONICAL_ANY },\n parameters: [\n {\n name: 'args',\n type: spec.CANONICAL_ANY,\n variadic: true,\n },\n ],\n variadic: true,\n };\n }\n\n this._defineOverridenMethod(obj, objref, override, methodInfo);\n }\n\n private _defineOverridenMethod(\n obj: any,\n objref: api.ObjRef,\n override: api.MethodOverride,\n methodInfo: spec.Method,\n ) {\n const methodName = override.method;\n\n if (methodInfo.async) {\n // async method override\n Object.defineProperty(obj, methodName, {\n enumerable: false,\n configurable: false,\n writable: false,\n value: (...methodArgs: any[]) => {\n this._debug('invoke async method override', override);\n const args = this._toSandboxValues(methodArgs, methodInfo.parameters);\n return new Promise((succeed, fail) => {\n const cbid = this._makecbid();\n this._debug('adding callback to queue', cbid);\n this.cbs[cbid] = {\n objref,\n override,\n args,\n expectedReturnType: methodInfo.returns ?? 'void',\n succeed,\n fail,\n };\n });\n },\n });\n } else {\n // sync method override (method info is not required)\n Object.defineProperty(obj, methodName, {\n enumerable: false,\n configurable: false,\n writable: false,\n value: (...methodArgs: any[]) => {\n this._debug(\n 'invoke sync method override',\n override,\n 'args',\n methodArgs,\n );\n // We should be validating the actual arguments according to the\n // declared parameters here, but let's just assume the JSII runtime on the\n // other end has done its work.\n const result = this.callbackHandler({\n cookie: override.cookie,\n cbid: this._makecbid(),\n invoke: {\n objref,\n method: methodName,\n args: this._fromSandboxValues(methodArgs, methodInfo.parameters),\n },\n });\n this._debug('Result', result);\n return this._toSandbox(result, methodInfo.returns ?? 'void');\n },\n });\n }\n }\n\n private _findInvokeTarget(\n objref: api.ObjRef,\n methodName: string,\n args: any[],\n ) {\n const { instance, fqn, interfaces } = this.objects.findObject(objref);\n const ti = this._typeInfoForMethod(methodName, fqn, interfaces);\n this._validateMethodArguments(ti, args);\n\n // always first look up the method in the prototype. this practically bypasses\n // any methods overridden by derived classes (which are by definition native\n // methods). this serves to allow native call to invoke \"super.method()\" when\n // overriding the method.\n // if we didn't find the method on the prototype, it could be a literal object\n // that implements an interface, so we look if we have the method on the object\n // itself. if we do, we invoke it.\n let fn = instance.constructor.prototype[methodName];\n if (!fn) {\n fn = instance[methodName];\n if (!fn) {\n throw new Error(`Cannot find ${methodName} on object`);\n }\n }\n return { ti, obj: instance, fn };\n }\n\n private _validateMethodArguments(\n method: spec.Callable | undefined,\n args: any[],\n ) {\n const params: spec.Parameter[] = method?.parameters ?? [];\n\n // error if args > params\n if (args.length > params.length && !(method && method.variadic)) {\n throw new Error(\n `Too many arguments (method accepts ${params.length} parameters, got ${args.length} arguments)`,\n );\n }\n\n for (let i = 0; i < params.length; ++i) {\n const param = params[i];\n const arg = args[i];\n\n if (param.variadic) {\n if (params.length <= i) {\n return;\n } // No vararg was provided\n for (let j = i; j < params.length; j++) {\n if (!param.optional && params[j] === undefined) {\n throw new Error(\n `Unexpected 'undefined' value at index ${\n j - i\n } of variadic argument '${\n param.name\n }' of type '${spec.describeTypeReference(param.type)}'`,\n );\n }\n }\n } else if (!param.optional && arg === undefined) {\n throw new Error(\n `Not enough arguments. Missing argument for the required parameter '${\n param.name\n }' of type '${spec.describeTypeReference(param.type)}'`,\n );\n }\n }\n }\n\n private _assemblyFor(assemblyName: string) {\n const assembly = this.assemblies[assemblyName];\n if (!assembly) {\n throw new Error(`Could not find assembly: ${assemblyName}`);\n }\n return assembly;\n }\n\n private _findSymbol(fqn: string) {\n const [assemblyName, ...parts] = fqn.split('.');\n const assembly = this._assemblyFor(assemblyName);\n\n let curr = assembly.closure;\n while (parts.length > 0) {\n const name = parts.shift();\n if (!name) {\n break;\n }\n\n curr = curr[name];\n }\n if (!curr) {\n throw new Error(`Could not find symbol ${fqn}`);\n }\n return curr;\n }\n\n private _typeInfoForFqn(fqn: string): spec.Type {\n const components = fqn.split('.');\n const moduleName = components[0];\n\n const assembly = this.assemblies[moduleName];\n if (!assembly) {\n throw new Error(`Module '${moduleName}' not found`);\n }\n\n const types = assembly.metadata.types ?? {};\n const fqnInfo = types[fqn];\n if (!fqnInfo) {\n throw new Error(`Type '${fqn}' not found`);\n }\n\n return fqnInfo;\n }\n\n private _typeInfoForMethod(\n methodName: string,\n fqn: string,\n interfaces?: string[],\n ): spec.Method {\n const ti = this._tryTypeInfoForMethod(methodName, fqn, interfaces);\n if (!ti) {\n const addendum =\n interfaces && interfaces.length > 0\n ? ` or interface(s) ${interfaces.join(', ')}`\n : '';\n throw new Error(\n `Class ${fqn}${addendum} doesn't have a method '${methodName}'`,\n );\n }\n return ti;\n }\n\n private _tryTypeInfoForMethod(\n methodName: string,\n classFqn: string,\n interfaces: string[] = [],\n ): spec.Method | undefined {\n for (const fqn of [classFqn, ...interfaces]) {\n if (fqn === 'Object') {\n continue;\n }\n const typeinfo = this._typeInfoForFqn(fqn);\n\n const methods =\n (typeinfo as spec.ClassType | spec.InterfaceType).methods ?? [];\n\n for (const m of methods) {\n if (m.name === methodName) {\n return m;\n }\n }\n\n // recursion to parent type (if exists)\n const bases = [\n (typeinfo as spec.ClassType).base,\n ...((typeinfo as spec.InterfaceType).interfaces ?? []),\n ];\n for (const base of bases) {\n if (!base) {\n continue;\n }\n\n const found = this._tryTypeInfoForMethod(methodName, base);\n if (found) {\n return found;\n }\n }\n }\n\n return undefined;\n }\n\n private _tryTypeInfoForProperty(\n property: string,\n classFqn: string,\n interfaces: string[] = [],\n ): spec.Property | undefined {\n for (const fqn of [classFqn, ...interfaces]) {\n if (fqn === wire.EMPTY_OBJECT_FQN) {\n continue;\n }\n const typeInfo = this._typeInfoForFqn(fqn);\n\n let properties;\n let bases;\n\n if (spec.isClassType(typeInfo)) {\n const classTypeInfo = typeInfo as spec.ClassType;\n properties = classTypeInfo.properties;\n bases = classTypeInfo.base ? [classTypeInfo.base] : [];\n } else if (spec.isInterfaceType(typeInfo)) {\n const interfaceTypeInfo = typeInfo as spec.InterfaceType;\n properties = interfaceTypeInfo.properties;\n bases = interfaceTypeInfo.interfaces ?? [];\n } else {\n throw new Error(\n `Type of kind ${typeInfo.kind} does not have properties`,\n );\n }\n\n for (const p of properties ?? []) {\n if (p.name === property) {\n return p;\n }\n }\n\n // recurse to parent type (if exists)\n for (const baseFqn of bases) {\n const ret = this._tryTypeInfoForProperty(property, baseFqn);\n if (ret) {\n return ret;\n }\n }\n }\n\n return undefined;\n }\n\n private _typeInfoForProperty(\n property: string,\n fqn: string,\n interfaces?: string[],\n ): spec.Property {\n const typeInfo = this._tryTypeInfoForProperty(property, fqn, interfaces);\n if (!typeInfo) {\n const addendum =\n interfaces && interfaces.length > 0\n ? ` or interface(s) ${interfaces.join(', ')}`\n : '';\n throw new Error(\n `Type ${fqn}${addendum} doesn't have a property '${property}'`,\n );\n }\n return typeInfo;\n }\n\n private _toSandbox(v: any, expectedType: wire.OptionalValueOrVoid): any {\n const serTypes = wire.serializationType(\n expectedType,\n this._typeInfoForFqn.bind(this),\n );\n this._debug('toSandbox', v, JSON.stringify(serTypes));\n\n const host: wire.SerializerHost = {\n objects: this.objects,\n debug: this._debug.bind(this),\n findSymbol: this._findSymbol.bind(this),\n lookupType: this._typeInfoForFqn.bind(this),\n recurse: this._toSandbox.bind(this),\n };\n\n const errors = new Array();\n for (const { serializationClass, typeRef } of serTypes) {\n try {\n return wire.SERIALIZERS[serializationClass].deserialize(\n v,\n typeRef,\n host,\n );\n } catch (e) {\n // If no union (99% case), rethrow immediately to preserve stack trace\n if (serTypes.length === 1) {\n throw e;\n }\n errors.push(e.message);\n }\n }\n\n throw new Error(\n `Value did not match any type in union: ${errors.join(', ')}`,\n );\n }\n\n private _fromSandbox(v: any, targetType: wire.OptionalValueOrVoid): any {\n const serTypes = wire.serializationType(\n targetType,\n this._typeInfoForFqn.bind(this),\n );\n this._debug('fromSandbox', v, JSON.stringify(serTypes));\n\n const host: wire.SerializerHost = {\n objects: this.objects,\n debug: this._debug.bind(this),\n findSymbol: this._findSymbol.bind(this),\n lookupType: this._typeInfoForFqn.bind(this),\n recurse: this._fromSandbox.bind(this),\n };\n\n const errors = new Array();\n for (const { serializationClass, typeRef } of serTypes) {\n try {\n return wire.SERIALIZERS[serializationClass].serialize(v, typeRef, host);\n } catch (e) {\n // If no union (99% case), rethrow immediately to preserve stack trace\n if (serTypes.length === 1) {\n throw e;\n }\n errors.push(e.message);\n }\n }\n\n throw new Error(\n `Value did not match any type in union: ${errors.join(', ')}`,\n );\n }\n\n private _toSandboxValues(xs: any[], parameters?: spec.Parameter[]) {\n return this._boxUnboxParameters(xs, parameters, this._toSandbox.bind(this));\n }\n\n private _fromSandboxValues(xs: any[], parameters?: spec.Parameter[]) {\n return this._boxUnboxParameters(\n xs,\n parameters,\n this._fromSandbox.bind(this),\n );\n }\n\n private _boxUnboxParameters(\n xs: any[],\n parameters: spec.Parameter[] | undefined,\n boxUnbox: (x: any, t: wire.OptionalValueOrVoid) => any,\n ) {\n parameters = [...(parameters ?? [])];\n const variadic =\n parameters.length > 0 && !!parameters[parameters.length - 1].variadic;\n // Repeat the last (variadic) type to match the number of actual arguments\n while (variadic && parameters.length < xs.length) {\n parameters.push(parameters[parameters.length - 1]);\n }\n if (xs.length > parameters.length) {\n throw new Error(\n `Argument list (${JSON.stringify(\n xs,\n )}) not same size as expected argument list (length ${\n parameters.length\n })`,\n );\n }\n return xs.map((x, i) => boxUnbox(x, parameters![i]));\n }\n\n private _debug(...args: any[]) {\n if (this.traceEnabled) {\n console.error('[@jsii/kernel]', ...args);\n }\n }\n\n /**\n * Ensures that `fn` is called and defends against beginning to invoke\n * async methods until fn finishes (successfully or not).\n */\n private _ensureSync(desc: string, fn: () => T): T {\n this.syncInProgress = desc;\n try {\n return fn();\n } finally {\n delete this.syncInProgress;\n }\n }\n\n private _findPropertyTarget(obj: any, property: string) {\n const superProp = this._getSuperPropertyName(property);\n if (superProp in obj) {\n return superProp;\n }\n return property;\n }\n\n //\n // type information\n //\n\n private _makecbid() {\n return `jsii::callback::${this.nextid++}`;\n }\n\n private _makeprid() {\n return `jsii::promise::${this.nextid++}`;\n }\n\n private _wrapSandboxCode(fn: () => T): T {\n return fn();\n }\n\n /**\n * Executes arbitrary code in a VM sandbox.\n *\n * @param code JavaScript code to be executed in the VM\n * @param sandbox a VM context to use for running the code\n * @param sourceMaps source maps to be used in case an exception is thrown\n * @param filename the file name to use for the executed code\n *\n * @returns the result of evaluating the code\n */\n private _execute(code: string, filename: string) {\n const script = new vm.Script(code, { filename });\n return script.runInContext(this.sandbox, { displayErrors: true });\n }\n}\n\ninterface Callback {\n objref: api.ObjRef;\n override: api.MethodOverride;\n args: any[];\n expectedReturnType: wire.OptionalValueOrVoid;\n\n // completion callbacks\n succeed: (...args: any[]) => any;\n fail: (...args: any[]) => any;\n}\n\ninterface AsyncInvocation {\n method: spec.Method;\n promise: Promise;\n}\n\nclass Assembly {\n public constructor(\n public readonly metadata: spec.Assembly,\n public readonly closure: any,\n ) {}\n}\n","import * as spec from '@jsii/spec';\n\nimport * as api from './api';\nimport { EMPTY_OBJECT_FQN } from './serialization';\n\n/**\n * Symbol under which we store the { type -> objid } map on object instances\n */\nconst OBJID_SYMBOL = Symbol.for('$__jsii__objid__$');\n\n/**\n * Symbol under which we store the interfaces implemented by instances\n */\nconst IFACES_SYMBOL = Symbol.for('$__jsii__interfaces__$');\n\n/**\n * Symbol we use to tag the constructor of a JSII class\n */\nconst JSII_SYMBOL = Symbol.for('__jsii__');\n\n/**\n * Get the JSII fqn for an object (if available)\n *\n * This will return something if the object was constructed from a JSII-enabled\n * class/constructor, or if a literal object was annotated with type\n * information.\n */\nexport function jsiiTypeFqn(obj: any): string | undefined {\n return obj.constructor[JSII_SYMBOL]?.fqn;\n}\n\n/**\n * If this object was previously serialized under a given reference, return the same reference\n *\n * This is to retain object identity across invocations.\n */\nexport function objectReference(obj: unknown): api.AnnotatedObjRef | undefined {\n // If this object as already returned\n if ((obj as any)[OBJID_SYMBOL]) {\n return {\n [api.TOKEN_REF]: (obj as ManagedObject)[OBJID_SYMBOL],\n [api.TOKEN_INTERFACES]: (obj as ManagedObject)[IFACES_SYMBOL],\n };\n }\n\n return undefined;\n}\n\ntype ManagedObject = {\n [OBJID_SYMBOL]: string;\n [IFACES_SYMBOL]?: string[];\n};\n\nfunction tagObject(obj: unknown, objid: string, interfaces?: string[]) {\n const managed = obj as ManagedObject;\n managed[OBJID_SYMBOL] = objid;\n managed[IFACES_SYMBOL] = interfaces;\n}\n\n/**\n * Set the JSII FQN for classes produced by a given constructor\n */\nexport function tagJsiiConstructor(constructor: any, fqn: string) {\n Object.defineProperty(constructor, JSII_SYMBOL, {\n configurable: false,\n enumerable: false,\n writable: false,\n value: { fqn },\n });\n}\n\n/**\n * Table of JSII objects\n *\n * There can be multiple references to the same object, each under a different requested\n * type.\n */\nexport class ObjectTable {\n private objects: { [objid: string]: RegisteredObject } = {};\n private nextid = 10000;\n\n public constructor(\n private readonly resolveType: (fqn: string) => spec.Type,\n ) {}\n\n /**\n * Register the given object with the given type\n *\n * Return the existing registration if available.\n */\n public registerObject(\n obj: unknown,\n fqn: string,\n interfaces?: string[],\n ): api.AnnotatedObjRef {\n if (fqn === undefined) {\n throw new Error('FQN cannot be undefined');\n }\n\n const existingRef = objectReference(obj);\n if (existingRef) {\n if (interfaces) {\n const allIfaces = new Set(interfaces);\n for (const iface of existingRef[api.TOKEN_INTERFACES] ?? []) {\n allIfaces.add(iface);\n }\n this.objects[existingRef[api.TOKEN_REF]].interfaces = (obj as any)[\n IFACES_SYMBOL\n ] = existingRef[\n api.TOKEN_INTERFACES\n ] = interfaces = this.removeRedundant(Array.from(allIfaces), fqn);\n }\n return existingRef;\n }\n\n interfaces = this.removeRedundant(interfaces, fqn);\n\n const objid = this.makeId(fqn);\n this.objects[objid] = { instance: obj, fqn, interfaces };\n tagObject(obj, objid, interfaces);\n\n return { [api.TOKEN_REF]: objid, [api.TOKEN_INTERFACES]: interfaces };\n }\n\n /**\n * Find the object and registered type for the given ObjRef\n */\n public findObject(objref: api.ObjRef): RegisteredObject {\n if (typeof objref !== 'object' || !(api.TOKEN_REF in objref)) {\n throw new Error(`Malformed object reference: ${JSON.stringify(objref)}`);\n }\n\n const objid = objref[api.TOKEN_REF];\n const obj = this.objects[objid];\n if (!obj) {\n throw new Error(`Object ${objid} not found`);\n }\n return obj;\n }\n\n /**\n * Delete the registration with the given objref\n */\n public deleteObject(objref: api.ObjRef) {\n this.findObject(objref); // make sure object exists\n delete this.objects[objref[api.TOKEN_REF]];\n }\n\n public get count(): number {\n return Object.keys(this.objects).length;\n }\n\n private makeId(fqn: string) {\n return `${fqn}@${this.nextid++}`;\n }\n\n private removeRedundant(\n interfaces: string[] | undefined,\n fqn: string,\n ): string[] | undefined {\n if (!interfaces || interfaces.length === 0) {\n return undefined;\n }\n\n const result = new Set(interfaces);\n const builtIn = new InterfaceCollection(this.resolveType);\n\n if (fqn !== EMPTY_OBJECT_FQN) {\n builtIn.addFromClass(fqn);\n }\n interfaces.forEach(builtIn.addFromInterface.bind(builtIn));\n\n for (const iface of builtIn) {\n result.delete(iface);\n }\n\n return result.size > 0 ? Array.from(result).sort() : undefined;\n }\n}\n\nexport interface RegisteredObject {\n instance: any;\n fqn: string;\n interfaces?: string[];\n}\n\nclass InterfaceCollection implements Iterable {\n private readonly interfaces = new Set();\n\n public constructor(\n private readonly resolveType: (fqn: string) => spec.Type,\n ) {}\n\n public addFromClass(fqn: string): void {\n const ti = this.resolveType(fqn);\n if (!spec.isClassType(ti)) {\n throw new Error(\n `Expected a class, but received ${spec.describeTypeReference(ti)}`,\n );\n }\n if (ti.base) {\n this.addFromClass(ti.base);\n }\n if (ti.interfaces) {\n for (const iface of ti.interfaces) {\n if (this.interfaces.has(iface)) {\n continue;\n }\n this.interfaces.add(iface);\n this.addFromInterface(iface);\n }\n }\n }\n\n public addFromInterface(fqn: string): void {\n const ti = this.resolveType(fqn);\n if (!spec.isInterfaceType(ti)) {\n throw new Error(\n `Expected an interface, but received ${spec.describeTypeReference(ti)}`,\n );\n }\n if (!ti.interfaces) {\n return;\n }\n for (const iface of ti.interfaces) {\n if (this.interfaces.has(iface)) {\n continue;\n }\n this.interfaces.add(iface);\n this.addFromInterface(iface);\n }\n }\n\n public [Symbol.iterator]() {\n return this.interfaces[Symbol.iterator]();\n }\n}\n","import * as fs from 'fs-extra';\nimport * as process from 'process';\n\nconst removeSyncPaths = new Array();\n\nexport function removeSync(path: string): void {\n registerIfNeeded();\n removeSyncPaths.push(path);\n}\n\nlet registered = false;\n\n/**\n * Registers the exist handler if it has not been registered already. This is done exactly ocne per\n * process, so that processes with multiple kernels don't end up creating too many exit handlers, as\n * this reduces the chances they will correctly run.\n */\nfunction registerIfNeeded() {\n if (registered) {\n return;\n }\n process.once('exit', onExitHandler);\n registered = true;\n\n function onExitHandler() {\n if (removeSyncPaths.length > 0) {\n for (const path of removeSyncPaths) {\n fs.removeSync(path);\n }\n }\n }\n}\n","/**\n * Handling of types in JSII\n *\n * Types will be serialized according to the following table:\n *\n * ┬───────────────────────────────────────────────────────────────────────────────────────────────┐\n * │ JAVASCRIPT TYPE │\n * ┼────────────────┬───────────┬────────────┬───────────────┬───────────────────┬─────────────────┤\n * │ undefined/null │ date │ scalar (*) │ array │ JSII-class object │ literal object │\n * ├──────────┼────────────┼────────────────┼───────────┼────────────┼───────────────┼───────────────────┼─────────────────┤\n * │ DECLARED │ void │ undefined │ undefined │ undefined │ undefined │ undefined │ undefined │\n * │ TYPE │ date │ undefined(†) │ { date } │ - │ - │ - │ - │\n * │ │ scalar (*) │ undefined(†) │ - │ value │ - │ - │ - │\n * │ │ json │ undefined │ string │ value │ array/R(json) │ - │ byvalue/R(json) │\n * │ │ enum │ undefined(†) │ - │ { enum } │ - │ - │ - │\n * │ │ array of T │ undefined(†) │ - │ - │ array/R(T) │ - │ - │\n * │ │ map of T │ undefined(†) │ - │ - │ - │ - │ byvalue/R(T) │\n * │ │ interface │ undefined(†) │ - │ - │ - │ { ref } │ { ref: proxy } │\n * │ │ struct │ undefined(†) │ - │ - │ - │ - │ byvalue/R(T[k]) │\n * │ │ class │ undefined(†) │ - │ - │ - │ { ref } │ { ref: proxy } │\n * │ │ any │ undefined │ { date } │ value │ array/R(any) │ { ref } │ byvalue/R(any) │\n * └──────────┴────────────┴────────────────┴───────────┴────────────┴───────────────┴───────────────────┴─────────────────┘\n *\n * - (*) scalar means 'string | number | boolean'\n * - (†) throw if not nullable\n * - /R(t) recurse with declared type t\n */\n\nimport * as spec from '@jsii/spec';\n\nimport {\n isObjRef,\n isWireDate,\n isWireEnum,\n isWireMap,\n ObjRef,\n TOKEN_DATE,\n TOKEN_ENUM,\n TOKEN_MAP,\n WireDate,\n WireEnum,\n isWireStruct,\n TOKEN_STRUCT,\n} from './api';\nimport { jsiiTypeFqn, objectReference, ObjectTable } from './objects';\n\nimport { api } from '.';\n\n/**\n * A specific singleton type to be explicit about a Void type\n *\n * In the spec, 'void' is represented as 'undefined'(*), but allowing the\n * value 'undefined' in function calls has lead to consumers failing to pass\n * type information that they had, just because they didn't \"have to\" (the\n * parameter was optional).\n *\n * (*) As in, declaration of a method looks like { returns?: TypeReference }\n * and the absence of a type means it returns 'void'.\n */\nexport type Void = 'void';\n\n/**\n * A type instance, or Void\n */\nexport type OptionalValueOrVoid = spec.OptionalValue | Void;\n\n/**\n * A special FQN that can be used to create empty javascript objects.\n */\nexport const EMPTY_OBJECT_FQN = 'Object';\n\nexport const SYMBOL_WIRE_TYPE = Symbol.for('$jsii$wireType$');\n\n/**\n * The type kind, that controls how it will be serialized according to the above table\n */\nexport const enum SerializationClass {\n Void = 'Void',\n Date = 'Date',\n Scalar = 'Scalar',\n Json = 'Json',\n Enum = 'Enum',\n Array = 'Array',\n Map = 'Map',\n Struct = 'Struct',\n ReferenceType = 'RefType',\n Any = 'Any',\n}\n\ntype TypeLookup = (fqn: spec.FQN) => spec.Type;\ntype SymbolLookup = (fqn: spec.FQN) => any;\n\nexport interface SerializerHost {\n readonly objects: ObjectTable;\n debug(...args: any[]): void;\n lookupType(fqn: string): spec.Type;\n recurse(x: any, type: OptionalValueOrVoid): any;\n findSymbol(fqn: spec.FQN): any;\n}\n\ninterface Serializer {\n serialize(\n value: unknown,\n type: OptionalValueOrVoid,\n host: SerializerHost,\n ): any;\n deserialize(\n value: unknown,\n type: OptionalValueOrVoid,\n host: SerializerHost,\n ): any;\n}\n\nexport const SERIALIZERS: { [k: string]: Serializer } = {\n // ----------------------------------------------------------------------\n [SerializationClass.Void]: {\n serialize(value, _type, host) {\n if (value != null) {\n host.debug('Expected void, got', value);\n }\n return undefined;\n },\n\n deserialize(value, _type, host) {\n if (value != null) {\n host.debug('Expected void, got', value);\n }\n return undefined;\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Date]: {\n serialize(value, optionalValue): WireDate | undefined {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (!isDate(value)) {\n throw new Error(`Expected Date, got ${JSON.stringify(value)}`);\n }\n return serializeDate(value);\n },\n\n deserialize(value, optionalValue) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n\n if (!isWireDate(value)) {\n throw new Error(`Expected Date, got ${JSON.stringify(value)}`);\n }\n return deserializeDate(value);\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Scalar]: {\n serialize(value, optionalValue) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n const primitiveType = optionalValue.type as spec.PrimitiveTypeReference;\n\n if (!isScalar(value)) {\n throw new Error(\n `Expected ${spec.describeTypeReference(\n optionalValue.type,\n )}, got ${JSON.stringify(value)}`,\n );\n }\n if (typeof value !== primitiveType.primitive) {\n throw new Error(\n `Expected a ${spec.describeTypeReference(\n optionalValue.type,\n )}, got ${JSON.stringify(value)} (${typeof value})`,\n );\n }\n return value;\n },\n\n deserialize(value, optionalValue) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n const primitiveType = optionalValue.type as spec.PrimitiveTypeReference;\n\n if (!isScalar(value)) {\n throw new Error(\n `Expected a ${spec.describeTypeReference(\n optionalValue.type,\n )}, got ${JSON.stringify(value)}`,\n );\n }\n if (typeof value !== primitiveType.primitive) {\n throw new Error(\n `Expected a ${spec.describeTypeReference(\n optionalValue.type,\n )}, got ${JSON.stringify(value)} (${typeof value})`,\n );\n }\n\n return value;\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Json]: {\n serialize(value) {\n // Just whatever. Dates will automatically serialize themselves to strings.\n return value;\n },\n deserialize(value, optionalValue, host) {\n // /!\\ Top-level \"null\" will turn to undefined, but any null nested in the value is valid JSON, so it'll stay!\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n\n // A mapping object can arrive though here. This would be the case if anything that is valid into a Map\n // is passed into a JSON transfer point. Indeed, those are also valid JSON! For example, Python \"dicts\" will be\n // serialized (by the Python runtime) as a $jsii.map (the mapping object). We need to de-serialize that as a\n // Map in order to obtain the correct output behavior here!\n if (isWireMap(value)) {\n return SERIALIZERS[SerializationClass.Map].deserialize(\n value,\n {\n optional: false,\n type: {\n collection: {\n kind: spec.CollectionKind.Map,\n elementtype: { primitive: spec.PrimitiveType.Json },\n },\n },\n },\n host,\n );\n }\n\n if (typeof value !== 'object') {\n return value;\n }\n\n if (Array.isArray(value)) {\n return value.map(mapJsonValue);\n }\n\n return mapValues(value, mapJsonValue);\n\n function mapJsonValue(toMap: any) {\n if (toMap == null) {\n return toMap;\n }\n return host.recurse(toMap, {\n type: { primitive: spec.PrimitiveType.Json },\n });\n }\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Enum]: {\n serialize(value, optionalValue, host): WireEnum | undefined {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (typeof value !== 'string' && typeof value !== 'number') {\n throw new Error(`Expected enum value, got ${JSON.stringify(value)}`);\n }\n\n host.debug('Serializing enum');\n\n const enumType = optionalValue.type as spec.NamedTypeReference;\n const enumMap = host.findSymbol(enumType.fqn);\n const enumEntry = Object.entries(enumMap).find(([, v]) => v === value);\n if (!enumEntry) {\n throw new Error(`No entry in ${enumType.fqn} has value ${value}`);\n }\n return { [TOKEN_ENUM]: `${enumType.fqn}/${enumEntry[0]}` };\n },\n deserialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n\n if (!isWireEnum(value)) {\n throw new Error(`Expected enum value, got ${JSON.stringify(value)}`);\n }\n\n return deserializeEnum(value, host.findSymbol);\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Array]: {\n serialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (!Array.isArray(value)) {\n throw new Error(`Expected array type, got ${JSON.stringify(value)}`);\n }\n\n const arrayType = optionalValue.type as spec.CollectionTypeReference;\n\n return value.map((x) =>\n host.recurse(x, { type: arrayType.collection.elementtype }),\n );\n },\n deserialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (!Array.isArray(value)) {\n throw new Error(`Expected array type, got ${JSON.stringify(value)}`);\n }\n\n const arrayType = optionalValue.type as spec.CollectionTypeReference;\n\n return value.map((x) =>\n host.recurse(x, { type: arrayType.collection.elementtype }),\n );\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Map]: {\n serialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n const mapType = optionalValue.type as spec.CollectionTypeReference;\n return {\n [TOKEN_MAP]: mapValues(value, (v) =>\n host.recurse(v, { type: mapType.collection.elementtype }),\n ),\n };\n },\n deserialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n const mapType = optionalValue.type as spec.CollectionTypeReference;\n if (!isWireMap(value)) {\n // Compatibility mode with older versions that didn't wrap in [TOKEN_MAP]\n return mapValues(value, (v) =>\n host.recurse(v, { type: mapType.collection.elementtype }),\n );\n }\n const result = mapValues(value[TOKEN_MAP], (v) =>\n host.recurse(v, { type: mapType.collection.elementtype }),\n );\n Object.defineProperty(result, SYMBOL_WIRE_TYPE, {\n configurable: false,\n enumerable: false,\n value: TOKEN_MAP,\n writable: false,\n });\n return result;\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Struct]: {\n serialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (typeof value !== 'object' || value == null) {\n throw new Error(`Expected object, got ${JSON.stringify(value)}`);\n }\n\n /*\n This is what we'd like to do, but we can't because at least the Java client\n does not understand by-value serialized interface types, so we'll have to\n serialize by-reference. Additionally, serializing known properties would\n cause problems when the return type of a method is a UNION of structs.\n See: https://github.com/aws/jsii/issues/400\n\n const props = propertiesOf(namedType);\n\n return mapValues(value, (v, key) => {\n if (!props[key]) { return undefined; } // Don't map if unknown property\n return host.recurse(v, props[key].type);\n });\n */\n\n host.debug('Returning value type by reference');\n return host.objects.registerObject(value, 'Object', [\n (optionalValue.type as spec.NamedTypeReference).fqn,\n ]);\n },\n deserialize(value, optionalValue, host) {\n if (typeof value === 'object' && Object.keys(value ?? {}).length === 0) {\n // Treat empty structs as `undefined` (see https://github.com/aws/jsii/issues/411)\n value = undefined;\n }\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (typeof value !== 'object' || value == null) {\n throw new Error(\n `Expected object reference, got ${JSON.stringify(value)}`,\n );\n }\n\n const namedType = host.lookupType(\n (optionalValue.type as spec.NamedTypeReference).fqn,\n );\n const props = propertiesOf(namedType, host.lookupType);\n\n if (Array.isArray(value)) {\n throw new Error(\n `Got an array where a ${namedType.fqn} was expected. Did you mean to pass a variable number of arguments?`,\n );\n }\n\n // Similarly to serialization, we might be getting a reference type where we're\n // expecting a value type. Accept this for now (but also validate that object\n // for presence of the right properties).\n if (isObjRef(value)) {\n host.debug(\n 'Expected value type but got reference type, accepting for now (awslabs/jsii#400)',\n );\n\n // Return same INSTANCE (shouldn't matter but we don't know for sure that it doesn't)\n return validateRequiredProps(\n host.objects.findObject(value).instance,\n namedType.fqn,\n props,\n );\n }\n\n if (api.isWireStruct(value)) {\n const { fqn, data } = value[api.TOKEN_STRUCT];\n if (!isAssignable(fqn, namedType, host.lookupType)) {\n throw new Error(\n `Wire struct type '${fqn}' does not match expected '${namedType.fqn}'`,\n );\n }\n value = data;\n }\n\n // Python, for example, allows using plain mapping objects instead of Structs (dyanmic typing, YOLO!)\n if (api.isWireMap(value)) {\n value = value[api.TOKEN_MAP];\n }\n\n value = validateRequiredProps(value as any, namedType.fqn, props);\n\n // Return a dict COPY, we have by-value semantics anyway.\n return mapValues(value, (v, key) => {\n if (!props[key]) {\n return undefined;\n } // Don't map if unknown property\n return host.recurse(v, props[key]);\n });\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.ReferenceType]: {\n serialize(value, optionalValue, host): ObjRef | undefined {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n if (typeof value !== 'object' || value == null) {\n throw new Error(\n `Expected object reference, got ${JSON.stringify(value)}`,\n );\n }\n\n const expectedType = host.lookupType(\n (optionalValue.type as spec.NamedTypeReference).fqn,\n );\n const interfaces = spec.isInterfaceType(expectedType)\n ? [expectedType.fqn]\n : undefined;\n const jsiiType =\n jsiiTypeFqn(value) ??\n (spec.isClassType(expectedType) ? expectedType.fqn : 'Object');\n\n return host.objects.registerObject(value, jsiiType, interfaces);\n },\n deserialize(value, optionalValue, host) {\n if (nullAndOk(value, optionalValue)) {\n return undefined;\n }\n if (optionalValue === 'void') {\n throw new Error('Encountered unexpected `void` type');\n }\n\n // The only way to pass a by-ref object is to have created it\n // previously inside JSII kernel, so it must have an objref already.\n\n if (!isObjRef(value)) {\n throw new Error(\n `Expected object reference, got ${JSON.stringify(value)}`,\n );\n }\n\n const { instance, fqn } = host.objects.findObject(value);\n\n const namedTypeRef = optionalValue.type as spec.NamedTypeReference;\n if (namedTypeRef.fqn !== EMPTY_OBJECT_FQN) {\n const namedType = host.lookupType(namedTypeRef.fqn);\n\n // Check that the object we got is of the right type\n // We only do this for classes, not interfaces, since Java might pass us objects that\n // privately implement some interface and we can't prove they don't.\n // https://github.com/aws/jsii/issues/399\n const declaredType = optionalValue.type as spec.NamedTypeReference;\n if (\n spec.isClassType(namedType) &&\n !isAssignable(fqn, declaredType, host.lookupType)\n ) {\n throw new Error(\n `Object of type ${fqn} is not convertible to ${declaredType.fqn}`,\n );\n }\n }\n\n return instance;\n },\n },\n\n // ----------------------------------------------------------------------\n [SerializationClass.Any]: {\n serialize(value, _type, host) {\n if (value == null) {\n return undefined;\n }\n\n if (isDate(value)) {\n return serializeDate(value);\n }\n if (isScalar(value)) {\n return value;\n }\n if (Array.isArray(value)) {\n return value.map((e) => host.recurse(e, { type: spec.CANONICAL_ANY }));\n }\n\n // Note: no case for \"ENUM\" here, without type declaration we can't tell the difference\n // between an enum member and a scalar.\n\n if (typeof value === 'function') {\n throw new Error(\n 'JSII Kernel is unable to serialize `function`. An instance with methods might have been returned by an `any` method?',\n );\n }\n\n if (typeof value !== 'object' || value == null) {\n throw new Error(\n `JSII kernel assumption violated, ${JSON.stringify(\n value,\n )} is not an object`,\n );\n }\n\n if (\n SYMBOL_WIRE_TYPE in value &&\n (value as any)[SYMBOL_WIRE_TYPE] === TOKEN_MAP\n ) {\n return SERIALIZERS[SerializationClass.Map].serialize(\n value,\n {\n type: {\n collection: {\n kind: spec.CollectionKind.Map,\n elementtype: spec.CANONICAL_ANY,\n },\n },\n },\n host,\n );\n }\n\n // To make sure people aren't going to try and return Map<> or Set<> out, test for\n // those and throw a descriptive error message. We can't detect these cases any other\n // way, and the by-value serialized object will be quite useless.\n if (value instanceof Set || value instanceof Map) {\n throw new Error(\"Can't return objects of type Set or Map\");\n }\n\n // Use a previous reference to maintain object identity. NOTE: this may cause us to return\n // a different type than requested! This is just how it is right now.\n // https://github.com/aws/jsii/issues/399\n const prevRef = objectReference(value);\n if (prevRef) {\n return prevRef;\n }\n\n // If this is or should be a reference type, pass or make the reference\n // (Like regular reftype serialization, but without the type derivation to an interface)\n const jsiiType =\n jsiiTypeFqn(value) ??\n (isByReferenceOnly(value) ? EMPTY_OBJECT_FQN : undefined);\n if (jsiiType) {\n return host.objects.registerObject(value, jsiiType);\n }\n\n // At this point we have an object that is not of an exported type. Either an object\n // literal, or an instance of a fully private class (cannot distinguish those cases).\n\n // We will serialize by-value, but recurse for serialization so that if\n // the object contains reference objects, they will be serialized appropriately.\n // (Basically, serialize anything else as a map of 'any').\n return mapValues(value, (v) =>\n host.recurse(v, { type: spec.CANONICAL_ANY }),\n );\n },\n\n deserialize(value, _type, host) {\n if (value == null) {\n return undefined;\n }\n\n if (isWireDate(value)) {\n host.debug('ANY is a Date');\n return deserializeDate(value);\n }\n if (isScalar(value)) {\n host.debug('ANY is a Scalar');\n return value;\n }\n if (Array.isArray(value)) {\n host.debug('ANY is an Array');\n return value.map((e) => host.recurse(e, { type: spec.CANONICAL_ANY }));\n }\n\n if (isWireEnum(value)) {\n host.debug('ANY is an Enum');\n return deserializeEnum(value, host.findSymbol);\n }\n if (isWireMap(value)) {\n host.debug('ANY is a Map');\n const mapOfAny: spec.CollectionTypeReference = {\n collection: {\n kind: spec.CollectionKind.Map,\n elementtype: spec.CANONICAL_ANY,\n },\n };\n return SERIALIZERS[SerializationClass.Map].deserialize(\n value,\n { type: mapOfAny },\n host,\n );\n }\n if (isObjRef(value)) {\n host.debug('ANY is a Ref');\n return host.objects.findObject(value).instance;\n }\n\n // if the value has a struct token, it was serialized by a typed jsii\n // struct, but since the deserialization target is ANY, all we can do is\n // strip the data from $jsii.struct and continue to deserialize as ANY.\n if (isWireStruct(value)) {\n const { fqn, data } = value[TOKEN_STRUCT];\n host.debug(`ANY is a struct of type ${fqn}`);\n return SERIALIZERS[SerializationClass.Struct].deserialize(\n data,\n { type: { fqn } },\n host,\n );\n }\n\n // At this point again, deserialize by-value.\n host.debug('ANY is a Map');\n return mapValues(value, (v) =>\n host.recurse(v, { type: spec.CANONICAL_ANY }),\n );\n },\n },\n};\n\nfunction serializeDate(value: Date): WireDate {\n return { [TOKEN_DATE]: value.toISOString() };\n}\n\nfunction deserializeDate(value: WireDate): Date {\n return new Date(value[TOKEN_DATE]);\n}\n\nfunction deserializeEnum(value: WireEnum, lookup: SymbolLookup) {\n const enumLocator = value[TOKEN_ENUM];\n const sep = enumLocator.lastIndexOf('/');\n if (sep === -1) {\n throw new Error(`Malformed enum value: ${JSON.stringify(value)}`);\n }\n\n const typeName = enumLocator.substr(0, sep);\n const valueName = enumLocator.substr(sep + 1);\n\n const enumValue = lookup(typeName)[valueName];\n if (enumValue === undefined) {\n throw new Error(`No enum member named ${valueName} in ${typeName}`);\n }\n return enumValue;\n}\n\nexport interface TypeSerialization {\n serializationClass: SerializationClass;\n typeRef: OptionalValueOrVoid;\n}\n\n/**\n * From a type reference, return the possible serialization types\n *\n * There can be multiple, because the type can be a type union.\n */\nexport function serializationType(\n typeRef: OptionalValueOrVoid,\n lookup: TypeLookup,\n): TypeSerialization[] {\n if (typeRef == null) {\n throw new Error(\"Kernel error: expected type information, got 'undefined'\");\n }\n if (typeRef === 'void') {\n return [{ serializationClass: SerializationClass.Void, typeRef }];\n }\n if (spec.isPrimitiveTypeReference(typeRef.type)) {\n switch (typeRef.type.primitive) {\n case spec.PrimitiveType.Any:\n return [{ serializationClass: SerializationClass.Any, typeRef }];\n case spec.PrimitiveType.Date:\n return [{ serializationClass: SerializationClass.Date, typeRef }];\n case spec.PrimitiveType.Json:\n return [{ serializationClass: SerializationClass.Json, typeRef }];\n case spec.PrimitiveType.Boolean:\n case spec.PrimitiveType.Number:\n case spec.PrimitiveType.String:\n return [{ serializationClass: SerializationClass.Scalar, typeRef }];\n }\n\n throw new Error('Unknown primitive type');\n }\n if (spec.isCollectionTypeReference(typeRef.type)) {\n return [\n {\n serializationClass:\n typeRef.type.collection.kind === spec.CollectionKind.Array\n ? SerializationClass.Array\n : SerializationClass.Map,\n typeRef,\n },\n ];\n }\n if (spec.isUnionTypeReference(typeRef.type)) {\n const compoundTypes = flatMap(typeRef.type.union.types, (t) =>\n serializationType({ type: t }, lookup),\n );\n // Propagate the top-level 'optional' field to each individual subtype\n for (const t of compoundTypes) {\n if (t.typeRef !== 'void') {\n t.typeRef.optional = typeRef.optional;\n }\n }\n return compoundTypes.sort((l, r) =>\n compareSerializationClasses(l.serializationClass, r.serializationClass),\n );\n }\n\n // The next part of the conversion is lookup-dependent\n const type = lookup(typeRef.type.fqn);\n\n if (spec.isEnumType(type)) {\n return [{ serializationClass: SerializationClass.Enum, typeRef }];\n }\n\n if (spec.isInterfaceType(type) && type.datatype) {\n return [{ serializationClass: SerializationClass.Struct, typeRef }];\n }\n\n return [{ serializationClass: SerializationClass.ReferenceType, typeRef }];\n}\n\nfunction nullAndOk(x: unknown, type: OptionalValueOrVoid): boolean {\n if (x != null) {\n return false;\n }\n\n if (type !== 'void' && !type.optional) {\n throw new Error(\n `Got 'undefined' for non-optional instance of ${JSON.stringify(type)}`,\n );\n }\n\n return true;\n}\n\nfunction isDate(x: unknown): x is Date {\n return (\n typeof x === 'object' &&\n Object.prototype.toString.call(x) === '[object Date]'\n );\n}\n\nfunction isScalar(x: unknown): x is string | number | boolean {\n return (\n typeof x === 'string' || typeof x === 'number' || typeof x === 'boolean'\n );\n}\n\nfunction flatMap(xs: T[], fn: (x: T) => U[]): U[] {\n const ret = new Array();\n for (const x of xs) {\n ret.push(...fn(x));\n }\n return ret;\n}\n\n/**\n * Map an object's values, skipping 'undefined' values'\n */\nfunction mapValues(\n value: unknown,\n fn: (value: any, field: string) => any,\n): { [key: string]: any } {\n if (typeof value !== 'object' || value == null) {\n throw new Error(`Expected object type, got ${JSON.stringify(value)}`);\n }\n\n const out: { [key: string]: any } = {};\n for (const [k, v] of Object.entries(value)) {\n const wireValue = fn(v, k);\n if (wireValue === undefined) {\n continue;\n }\n out[k] = wireValue;\n }\n return out;\n}\n\nfunction propertiesOf(\n t: spec.Type,\n lookup: TypeLookup,\n): { [name: string]: spec.Property } {\n if (!spec.isClassOrInterfaceType(t)) {\n return {};\n }\n\n let ret: { [name: string]: spec.Property } = {};\n\n if (t.interfaces) {\n for (const iface of t.interfaces) {\n ret = { ...ret, ...propertiesOf(lookup(iface), lookup) };\n }\n }\n if (spec.isClassType(t) && t.base) {\n ret = { ...ret, ...propertiesOf(lookup(t.base), lookup) };\n }\n\n for (const prop of t.properties ?? []) {\n ret[prop.name] = prop;\n }\n\n return ret;\n}\n\n/**\n * Tests whether a given type (by it's FQN) can be assigned to a named type reference.\n *\n * @param actualTypeFqn the FQN of the type that is being tested.\n * @param requiredType the required reference type.\n *\n * @returns true if ``requiredType`` is a super-type (base class or implemented interface) of the type designated by\n * ``actualTypeFqn``.\n */\nfunction isAssignable(\n actualTypeFqn: string,\n requiredType: spec.NamedTypeReference,\n lookup: TypeLookup,\n): boolean {\n // The empty object is assignable to everything\n if (actualTypeFqn === EMPTY_OBJECT_FQN) {\n return true;\n }\n\n if (requiredType.fqn === actualTypeFqn) {\n return true;\n }\n const actualType = lookup(actualTypeFqn);\n if (spec.isClassType(actualType)) {\n if (\n actualType.base &&\n isAssignable(actualType.base, requiredType, lookup)\n ) {\n return true;\n }\n }\n if (spec.isClassOrInterfaceType(actualType) && actualType.interfaces) {\n return (\n actualType.interfaces.find((iface) =>\n isAssignable(iface, requiredType, lookup),\n ) != null\n );\n }\n return false;\n}\n\nfunction validateRequiredProps(\n actualProps: { [key: string]: any },\n typeName: string,\n specProps: { [key: string]: spec.Property },\n) {\n // Check for required properties\n const missingRequiredProps = Object.keys(specProps)\n .filter((name) => !specProps[name].optional)\n .filter((name) => !(name in actualProps));\n\n if (missingRequiredProps.length > 0) {\n throw new Error(\n `Missing required properties for ${typeName}: ${missingRequiredProps.join(\n ', ',\n )}`,\n );\n }\n\n return actualProps;\n}\n\nfunction compareSerializationClasses(\n l: SerializationClass,\n r: SerializationClass,\n): number {\n const order = [\n SerializationClass.Void,\n SerializationClass.Date,\n SerializationClass.Scalar,\n SerializationClass.Json,\n SerializationClass.Enum,\n SerializationClass.Array,\n SerializationClass.Map,\n SerializationClass.Struct,\n SerializationClass.ReferenceType,\n SerializationClass.Any,\n ];\n return order.indexOf(l) - order.indexOf(r);\n}\n\n/**\n * Determines whether `obj` must be passed by-reference or if by-value is acceptable. For example,\n * objects with methods, or dynamic getters (or setters) should be passed by-reference as a matter\n * of security. The behavior in non-JS runtimes could otherwise differ from that in pure JS (if\n * getters are not stable, etc...).\n *\n * @param obj the object to be tested.\n *\n * @returns true if `obj` must be passed by-reference.\n */\nfunction isByReferenceOnly(obj: any): boolean {\n if (Array.isArray(obj)) {\n return false;\n }\n\n let curr = obj;\n // Crawl up the prototype chain to look for dynamic properties or methods.\n do {\n for (const prop of Object.getOwnPropertyNames(curr)) {\n const descr = Object.getOwnPropertyDescriptor(curr, prop);\n if (\n descr?.get != null ||\n descr?.set != null ||\n typeof descr?.value === 'function'\n ) {\n // Property has a dynamic getter, setter or is a constructor/method, so by-ref required!\n return true;\n }\n }\n // End when the parent proto is `Object`, which has no parent proto itself.\n } while (Object.getPrototypeOf((curr = Object.getPrototypeOf(curr))) != null);\n\n return false;\n}\n","import { api, Kernel } from '@jsii/kernel';\nimport { EventEmitter } from 'events';\n\nimport { Input, IInputOutput } from './in-out';\n\nexport class KernelHost {\n private readonly kernel = new Kernel(this.callbackHandler.bind(this));\n private readonly eventEmitter = new EventEmitter();\n\n public constructor(\n private readonly inout: IInputOutput,\n private readonly opts: { debug?: boolean; noStack?: boolean } = {},\n ) {\n this.kernel.traceEnabled = opts.debug ? true : false;\n }\n\n public run() {\n const req = this.inout.read();\n if (!req || 'exit' in req) {\n this.eventEmitter.emit('exit', req?.exit ?? 0);\n return; // done\n }\n\n this.processRequest(req, () => {\n // Schedule the call to run on the next event loop iteration to\n // avoid recursion.\n setImmediate(() => this.run());\n });\n }\n\n public once(event: 'exit', listener: (code: number) => void) {\n this.eventEmitter.once(event, listener);\n }\n\n private callbackHandler(callback: api.Callback) {\n // write a \"callback\" response, which is a special response that tells\n // the client that there's synchonous callback it needs to invoke and\n // bring back the result via a \"complete\" request.\n this.inout.write({ callback });\n\n return completeCallback.call(this);\n\n function completeCallback(this: KernelHost): void {\n const req = this.inout.read();\n if (!req || 'exit' in req) {\n throw new Error('Interrupted before callback returned');\n }\n\n // if this is a completion for the current callback, then we can\n // finally stop this nonsense and return the result.\n const completeReq = req as { complete: api.CompleteRequest };\n if (\n 'complete' in completeReq &&\n completeReq.complete.cbid === callback.cbid\n ) {\n if (completeReq.complete.err) {\n throw new Error(completeReq.complete.err);\n }\n\n return completeReq.complete.result;\n }\n\n // otherwise, process the request normally, but continue to wait for\n // our callback to be completed. sync=true to enforce that `completeCallback`\n // will be called synchronously and return value will be chained back so we can\n // return it to the callback handler.\n return this.processRequest(\n req,\n completeCallback.bind(this),\n /* sync */ true,\n );\n }\n }\n\n /**\n * Processes the input request `req` and writes the output response to\n * stdout. This method invokes `next` when the request was fully processed.\n * This either happens synchronously or asynchronously depending on the api\n * (e.g. the \"end\" api will wait for an async promise to be fulfilled before\n * it writes the response)\n *\n * @param req The input request\n * @param next A callback to invoke to continue\n * @param sync If this is 'true', \"next\" must be called synchronously. This means\n * that we won't process any async activity (begin/complete). The kernel\n * doesn't allow any async operations during a sync callback, so this shouldn't\n * happen, so we assert in this case to find bugs.\n */\n private processRequest(req: Input, next: () => void, sync = false) {\n if ('callback' in req) {\n throw new Error(\n 'Unexpected `callback` result. This request should have been processed by a callback handler',\n );\n }\n\n if (!('api' in req)) {\n throw new Error('Malformed request, \"api\" field is required');\n }\n\n const apiReq = req;\n const fn = this.findApi(apiReq.api);\n\n try {\n const ret = fn.call(this.kernel, req);\n\n // special case for 'begin' and 'complete' which are on an async\n // promise path. in order to allow the kernel to actually fulfill\n // the promise, and continue any async flows (which may potentially\n // start other promises), we respond only within a setImmediate\n // block, which is scheduled in the same micro-tasks queue as\n // promises. see the kernel test 'async overrides: two overrides'\n // for an example for this use case.\n if (apiReq.api === 'begin' || apiReq.api === 'complete') {\n checkIfAsyncIsAllowed();\n\n this.debug('processing pending promises before responding');\n\n setImmediate(() => {\n this.writeOkay(ret);\n next();\n });\n\n return undefined;\n }\n\n // if this is an async method, return immediately and\n // call next only when the promise is fulfilled.\n if (this.isPromise(ret)) {\n checkIfAsyncIsAllowed();\n\n this.debug('waiting for promise to be fulfilled');\n\n const promise = ret;\n promise\n .then((val) => {\n this.debug('promise succeeded:', val);\n this.writeOkay(val);\n next();\n })\n .catch((e) => {\n this.debug('promise failed:', e);\n this.writeError(e);\n next();\n });\n\n return undefined;\n }\n\n this.writeOkay(ret);\n } catch (e) {\n this.writeError(e);\n }\n\n // indicate this request was processed (synchronously).\n return next();\n\n function checkIfAsyncIsAllowed() {\n if (sync) {\n throw new Error(\n 'Cannot handle async operations while waiting for a sync callback to return',\n );\n }\n }\n }\n\n /**\n * Writes an \"ok\" result to stdout.\n */\n private writeOkay(result: any) {\n const res = { ok: result };\n this.inout.write(res);\n }\n\n /**\n * Writes an \"error\" result to stdout.\n */\n private writeError(error: any) {\n const res = { error: error.message, stack: undefined };\n if (!this.opts.noStack) {\n res.stack = error.stack;\n }\n this.inout.write(res);\n }\n\n /**\n * Returns true if the value is a promise.\n */\n private isPromise(v: any): v is Promise {\n return typeof v?.then === 'function';\n }\n\n /**\n * Given a kernel api name, returns the function to invoke.\n */\n private findApi(apiName: string): (this: Kernel, arg: Input) => any {\n const fn = (this.kernel as any)[apiName];\n if (typeof fn !== 'function') {\n throw new Error(`Invalid kernel api call: ${apiName}`);\n }\n return fn;\n }\n\n private debug(...args: any[]) {\n if (!this.opts.debug) {\n return;\n }\n\n console.error(...args);\n }\n}\n","import { api } from '@jsii/kernel';\n\nimport { SyncStdio } from './sync-stdio';\n\nexport type Output =\n | { hello: string }\n | { ok: api.KernelResponse }\n | { callback: api.Callback }\n | { pending: true }\n | { error: string; stack?: string };\n\nexport type Input =\n | ({ api: string } & api.KernelRequest)\n | { complete: api.CompleteRequest };\n\nexport type Exit = { exit: number };\n\n/**\n * An IO provider for jsii API exchanges.\n */\nexport interface IInputOutput {\n /**\n * Writes a message to the jsii API host.\n * @param message the message to be sent.\n */\n write(message: Output): void;\n\n /**\n * Wait for a message from the jsii API host, then return it.\n *\n * @returns the received message, or `undefined` if the API host has no more\n * requests to send.\n */\n read(): Input | Exit | undefined;\n}\n\nexport class InputOutput implements IInputOutput {\n public debug = false;\n\n public constructor(private readonly stdio: SyncStdio) {}\n\n public write(obj: Output) {\n const output = JSON.stringify(obj);\n this.stdio.writeLine(output);\n\n if (this.debug) {\n this.stdio.writeErrorLine(`< ${output}`);\n }\n }\n\n public read(): Input | undefined {\n let reqLine = this.stdio.readLine();\n if (!reqLine) {\n return undefined;\n }\n\n // skip recorded responses\n if (reqLine.startsWith('< ')) {\n return this.read();\n }\n\n // stip \"> \" from recorded requests\n if (reqLine.startsWith('> ')) {\n reqLine = reqLine.substr(2);\n }\n\n const input = JSON.parse(reqLine);\n\n if (this.debug) {\n this.stdio.writeErrorLine(`> ${JSON.stringify(input)}`);\n }\n\n return input;\n }\n}\n","import * as fs from 'fs';\n\nconst INPUT_BUFFER_SIZE = 1_048_576; // 1MiB (aka: 1024 * 1024), not related to max line length\n\nexport class SyncStdio {\n private bufferedData = Buffer.alloc(0);\n\n private readonly stderr: number;\n private readonly stdin: number;\n private readonly stdout: number;\n\n // A buffer that will be used for all reading operations.\n private readonly readBuffer = Buffer.alloc(INPUT_BUFFER_SIZE);\n\n public constructor({ errorFD, readFD, writeFD }: SyncStdioOptions) {\n this.stderr = errorFD;\n this.stdin = readFD;\n this.stdout = writeFD;\n }\n\n public writeErrorLine(line: string) {\n this.writeBuffer(Buffer.from(`${line}\\n`), this.stderr);\n }\n\n public writeLine(line: string) {\n this.writeBuffer(Buffer.from(`${line}\\n`), this.stdout);\n }\n\n public readLine(): string | undefined {\n while (!this.bufferedData.includes('\\n', 0, 'utf-8')) {\n const read = fs.readSync(\n this.stdin,\n this.readBuffer,\n 0,\n this.readBuffer.length,\n null,\n );\n\n if (read === 0) {\n return undefined;\n }\n\n const newData = this.readBuffer.slice(0, read);\n this.bufferedData = Buffer.concat([this.bufferedData, newData]);\n }\n\n const newLinePos = this.bufferedData.indexOf('\\n', 0, 'utf-8');\n const next = this.bufferedData.slice(0, newLinePos).toString('utf-8');\n this.bufferedData = this.bufferedData.slice(newLinePos + 1);\n\n return next;\n }\n\n private writeBuffer(buffer: Buffer, fd: number) {\n let offset = 0;\n while (offset < buffer.length) {\n try {\n offset += fs.writeSync(fd, buffer, offset);\n } catch (e) {\n // We might get EAGAIN if the file descriptor was not opened for\n // blocking (O_SYNC) writes. In such cases, we'll keep trying until it\n // succeeds. This shouldn't take long as the process on the other side\n // is expected to actively wait for data on those pipes.\n if (e.code !== 'EAGAIN') {\n throw e;\n }\n }\n }\n }\n}\n\nexport interface SyncStdioOptions {\n /**\n * The file descriptor from which data is to be read. This MUST be opened for\n * blocking (O_SYNC) reading.\n */\n readonly readFD: number;\n\n /**\n * The file descriptor to which data is to be written. This SHOULD be opened\n * for blocking (O_SYNC) writing.\n */\n readonly writeFD: number;\n\n /**\n * The file descriptor to which errors data is to be written. This SHOULD be\n * opened for blocking (O_SYNC) writing.\n */\n readonly errorFD: number;\n}\n","export const SPEC_FILE_NAME = '.jsii';\n\n/**\n * A JSII assembly specification.\n */\nexport interface Assembly extends AssemblyConfiguration, Documentable {\n /**\n * The version of the spec schema\n */\n schema: SchemaVersion.LATEST;\n\n /**\n * The name of the assembly\n *\n * @minLength 1\n */\n name: string;\n\n /**\n * Description of the assembly, maps to \"description\" from package.json\n * This is required since some package managers (like Maven) require it.\n */\n description: string;\n\n /**\n * The url to the project homepage. Maps to \"homepage\" from package.json.\n */\n homepage: string;\n\n /**\n * The module repository, maps to \"repository\" from package.json\n * This is required since some package managers (like Maven) require it.\n */\n repository: {\n /**\n * The type of the repository (``git``, ``svn``, ...)\n */\n type: string;\n\n /**\n * The URL of the repository.\n */\n url: string;\n\n /**\n * If the package is not in the root directory (for example, when part\n * of a monorepo), you should specify the directory in which it lives.\n *\n * @default the root of the repository\n */\n directory?: string;\n };\n\n /**\n * The main author of this package.\n */\n author: Person;\n\n /**\n * Additional contributors to this package.\n *\n * @default none\n */\n contributors?: Person[];\n\n /**\n * A fingerprint that can be used to determine if the specification has\n * changed.\n *\n * @minLength 1\n */\n fingerprint: string;\n\n /**\n * The version of the assembly\n * @minLength 1\n */\n version: string;\n\n /**\n * The version of the jsii compiler that was used to produce this Assembly.\n * @minLength 1\n */\n jsiiVersion: string;\n\n /**\n * The SPDX name of the license this assembly is distributed on.\n */\n license: string;\n\n /**\n * Arbitrary key-value pairs of metadata, which the maintainer chose to\n * document with the assembly. These entries do not carry normative\n * semantics and their interpretation is up to the assembly maintainer.\n *\n * @default none\n */\n metadata?: { [key: string]: any };\n\n /**\n * Keywords that help discover or identify this packages with respects to it's\n * intended usage, audience, etc... Where possible, this will be rendered in\n * the corresponding metadata section of idiomatic package manifests, for\n * example NuGet package tags.\n */\n keywords?: string[];\n\n /**\n * Direct dependencies on other assemblies (with semver), the key is the JSII\n * assembly name, and the value is a SemVer expression.\n *\n * @default none\n */\n dependencies?: { [assembly: string]: string };\n\n /**\n * Target configuration for all the assemblies that are direct or transitive\n * dependencies of this assembly. This is needed to generate correct native\n * type names for any transitively inherited member, in certain languages.\n *\n * @default none\n */\n dependencyClosure?: { [assembly: string]: AssemblyConfiguration };\n\n /**\n * List if bundled dependencies (these are not expected to be jsii\n * assemblies).\n *\n * @default none\n */\n bundled?: { [module: string]: string };\n\n /**\n * All types in the assembly, keyed by their fully-qualified-name\n *\n * @default none\n */\n types?: { [fqn: string]: Type };\n\n /**\n * List of bin-scripts\n *\n * @default none\n */\n bin?: { readonly [script: string]: string };\n}\n\n/**\n * Shareable configuration of a jsii Assembly.\n */\nexport interface AssemblyConfiguration extends Targetable {\n /**\n * Submodules declared in this assembly.\n *\n * @default none\n */\n submodules?: { [fqn: string]: Submodule };\n}\n\n/**\n * A targetable module-like thing\n *\n * Has targets and a readme. Used for Assemblies and Submodules.\n */\nexport interface Targetable {\n /**\n * A map of target name to configuration, which is used when generating\n * packages for various languages.\n *\n * @default none\n */\n targets?: AssemblyTargets;\n\n /**\n * The readme document for this module (if any).\n *\n * @default none\n */\n readme?: ReadMe;\n}\n\n/**\n * README information\n */\nexport interface ReadMe {\n markdown: string;\n}\n\n/**\n * A submodule\n *\n * The difference between a top-level module (the assembly) and a submodule is\n * that the submodule is annotated with its location in the repository.\n */\nexport type Submodule = SourceLocatable & Targetable;\n\n/**\n * Versions of the JSII Assembly Specification.\n */\nexport enum SchemaVersion {\n LATEST = 'jsii/0.10.0',\n}\n\n/**\n * Fully Qualified Name\n */\nexport type FQN = string;\n\n/**\n * Metadata about people or organizations associated with the project that\n * resulted in the Assembly. Some of this metadata is required in order to\n * publish to certain package repositories (for example, Maven Central), but is\n * not normalized, and the meaning of fields (role, for example), is up to each\n * project maintainer.\n */\nexport interface Person {\n /**\n * The name of the person\n */\n name: string;\n\n /**\n * A list of roles this person has in the project, for example `maintainer`,\n * `contributor`, `owner`, ...\n */\n roles: string[];\n\n /**\n * The email of the person\n *\n * @default none\n */\n email?: string;\n\n /**\n * The URL for the person\n *\n * @default none\n */\n url?: string;\n\n /**\n * If true, this person is, in fact, an organization\n *\n * @default false\n */\n organization?: boolean;\n}\n\n/**\n * Configurable targets for an asembly.\n */\nexport interface AssemblyTargets {\n /**\n * Information about a particular language's targets\n */\n [language: string]: { [key: string]: any } | undefined;\n}\n\n/**\n * Where in the module source the definition for this API item was found\n */\nexport interface SourceLocation {\n /**\n * Relative filename\n */\n filename: string;\n\n /**\n * 1-based line number in the indicated file\n */\n line: number;\n}\n\n/**\n * Key value pairs of documentation nodes.\n * Based on TSDoc.\n */\nexport interface Docs {\n /**\n * Summary documentation for an API item.\n *\n * The first part of the documentation before hitting a `@remarks` tags, or\n * the first line of the doc comment block if there is no `@remarks` tag.\n *\n * @default none\n */\n summary?: string;\n\n /**\n * Detailed information about an API item.\n *\n * Either the explicitly tagged `@remarks` section, otherwise everything\n * past the first paragraph if there is no `@remarks` tag.\n *\n * @default none\n */\n remarks?: string;\n\n /**\n * If present, this block indicates that an API item is no longer supported\n * and may be removed in a future release. The `@deprecated` tag must be\n * followed by a sentence describing the recommended alternative.\n * Deprecation recursively applies to members of a container. For example,\n * if a class is deprecated, then so are all of its members.\n *\n * @default none\n */\n deprecated?: string;\n\n /**\n * The `@returns` block for this doc comment, or undefined if there is not\n * one.\n *\n * @default none\n */\n returns?: string;\n\n /**\n * Whether the API item is beta/experimental quality\n */\n stability?: Stability;\n\n /**\n * Example showing the usage of this API item\n *\n * Starts off in running text mode, may switch to code using fenced code\n * blocks.\n *\n * @default none\n */\n example?: string;\n\n /**\n * A `@see` link with more information\n *\n * @default none\n */\n see?: string;\n\n /**\n * Whether this class or interface was intended to be subclassed/implemented\n * by library users.\n *\n * Classes intended for subclassing, and interfaces intended to be\n * implemented by consumers, are held to stricter standards of API\n * compatibility.\n *\n * @default false\n */\n subclassable?: boolean;\n\n /**\n * Description of the default\n *\n * @default none\n */\n default?: string;\n\n /**\n * Custom tags that are not any of the default ones\n *\n * @default none\n */\n custom?: { [tag: string]: string };\n}\n\n/**\n * API Stability levels. These are modeled after the `node` stability index.\n *\n * @see https://nodejs.org/api/documentation.html#documentation_stability_index.\n */\nexport enum Stability {\n /**\n * The API may emit warnings. Backward compatibility is not guaranteed.\n *\n * More information about the deprecation can usually be found in the\n * `deprecated` field.\n */\n Deprecated = 'deprecated',\n\n /**\n * This API is still under active development and subject to non-backward\n * compatible changes or removal in any future version. Use of the API is\n * not recommended in production environments. Experimental APIs are not\n * subject to the Semantic Versioning model.\n */\n Experimental = 'experimental',\n\n /**\n * This API is subject to the Semantic Versioning model and may not change\n * in breaking ways in a subsequent minor or patch version.\n */\n Stable = 'stable',\n\n /**\n * This API is an representation of an API managed elsewhere and follows\n * the other API's versioning model.\n */\n External = 'external',\n}\n\n/**\n * Indicates that an entity is documentable.\n */\nexport interface Documentable {\n /**\n * Documentation for this entity.\n *\n * @default none\n */\n docs?: Docs;\n}\n\n/**\n * Indicates that an entity has a source location\n */\nexport interface SourceLocatable {\n /**\n * Where in the module this definition was found\n *\n * Why is this not `locationInAssembly`? Because the assembly is the JSII\n * file combining compiled code and its manifest, whereas this is referring\n * to the location of the source in the module the assembly was built from.\n *\n * @default none\n */\n locationInModule?: SourceLocation;\n}\n\n/**\n * Kinds of collections.\n */\nexport enum CollectionKind {\n /**\n * An array, or a list of some element type.\n */\n Array = 'array',\n /**\n * A map of a string to some element type.\n */\n Map = 'map',\n}\n\n/**\n * Kinds of primitive types.\n */\nexport enum PrimitiveType {\n /**\n * A JSON date (represented as it's ISO-8601 string form).\n */\n Date = 'date',\n\n /**\n * A plain string.\n */\n String = 'string',\n\n /**\n * A number (integer or float).\n */\n Number = 'number',\n\n /**\n * A boolean value.\n */\n Boolean = 'boolean',\n\n /**\n * A JSON object\n */\n Json = 'json',\n\n /**\n * Value with \"any\" or \"unknown\" type (aka Object). Values typed `any` may\n * be `null` or `undefined`.\n */\n Any = 'any',\n}\n\n/**\n * A value that can possibly be optional.\n */\nexport interface OptionalValue {\n /**\n * Determines whether the value is, indeed, optional.\n *\n * @default false\n */\n optional?: boolean;\n\n /**\n * The declared type of the value, when it's present.\n */\n type: TypeReference;\n}\n\n/**\n * A reference to a type (primitive, collection or fqn).\n */\nexport type TypeReference =\n | NamedTypeReference\n | PrimitiveTypeReference\n | CollectionTypeReference\n | UnionTypeReference;\n\n/**\n * The standard representation of the `any` type (includes optionality marker).\n */\nexport const CANONICAL_ANY: Readonly = {\n primitive: PrimitiveType.Any,\n};\n\n/**\n * Reference to a named type, defined by this assembly or one of its\n * dependencies.\n */\nexport interface NamedTypeReference {\n /**\n * The fully-qualified-name of the type (can be located in the\n * ``spec.types[fqn]``` of the assembly that defines the type).\n */\n fqn: FQN;\n}\nexport function isNamedTypeReference(\n ref: TypeReference | undefined,\n): ref is NamedTypeReference {\n return !!(ref as NamedTypeReference)?.fqn;\n}\n\n/**\n * Reference to a primitive type.\n */\nexport interface PrimitiveTypeReference {\n /**\n * If this is a reference to a primitive type, this will include the\n * primitive type kind.\n */\n primitive: PrimitiveType;\n}\nexport function isPrimitiveTypeReference(\n ref: TypeReference | undefined,\n): ref is PrimitiveTypeReference {\n return !!(ref as PrimitiveTypeReference)?.primitive;\n}\n\n/**\n * Reference to a collection type.\n */\nexport interface CollectionTypeReference {\n collection: {\n /**\n * The kind of collection.\n */\n kind: CollectionKind;\n\n /**\n * The type of an element (map keys are always strings).\n */\n elementtype: TypeReference;\n };\n}\nexport function isCollectionTypeReference(\n ref: TypeReference | undefined,\n): ref is CollectionTypeReference {\n return !!(ref as CollectionTypeReference)?.collection;\n}\n\n/**\n * Reference to a union type.\n */\nexport interface UnionTypeReference {\n /**\n * Indicates that this is a union type, which means it can be one of a set\n * of types.\n */\n union: {\n /**\n * All the possible types (including the primary type).\n *\n * @minItems 2\n */\n types: TypeReference[];\n };\n}\nexport function isUnionTypeReference(\n ref: TypeReference | undefined,\n): ref is UnionTypeReference {\n return !!(ref as UnionTypeReference)?.union;\n}\n\n/**\n * Methods and properties can be overridden from parent classes or implemented\n * from interfaces.\n */\nexport interface Overridable {\n /**\n * The FQN of the parent type (class or interface) that this entity\n * overrides or implements. If undefined, then this entity is the first in\n * it's hierarchy to declare this entity.\n *\n * @default this member is not overriding anything\n */\n overrides?: FQN;\n}\n\n/**\n * A class property.\n */\nexport interface Property\n extends Documentable,\n OptionalValue,\n Overridable,\n SourceLocatable {\n /**\n * The name of the property.\n *\n * @minLength 1\n */\n name: string;\n\n /**\n * Indicates if this property only has a getter (immutable).\n *\n * @default false\n */\n immutable?: boolean;\n\n /**\n * Indicates if this property is protected (otherwise it is public)\n *\n * @default false\n */\n protected?: boolean;\n\n /**\n * Indicates if this property is abstract\n *\n * @default false\n */\n abstract?: boolean;\n\n /**\n * Indicates if this is a static property.\n *\n * @default false\n */\n static?: boolean;\n\n /**\n * A hint that indicates that this static, immutable property is initialized\n * during startup. This allows emitting \"const\" idioms in different target\n * languages. Implies `static` and `immutable`.\n *\n * @default false\n */\n const?: boolean;\n}\n\n/**\n * Represents a method parameter.\n */\nexport interface Parameter extends Documentable, OptionalValue {\n /**\n * The name of the parameter.\n *\n * @minLength 1\n */\n name: string;\n\n /**\n * Whether this is the last parameter of a variadic method. In such cases,\n * the `#type` attribute is the type of each individual item of the variadic\n * arguments list (as opposed to some array type, as for example TypeScript\n * would model it).\n *\n * @default false\n */\n variadic?: boolean;\n}\n\n/**\n * An Initializer or a Method.\n */\nexport interface Callable extends Documentable, Overridable, SourceLocatable {\n /**\n * The parameters of the Initializer or Method.\n *\n * @default none\n */\n parameters?: Parameter[];\n\n /**\n * Indicates if this Initializer or Method is protected (otherwise it is\n * public, since private members are not modeled).\n *\n * @default false\n */\n protected?: boolean;\n\n /**\n * Indicates whether this Initializer or Method is variadic or not. When\n * ``true``, the last element of ``#parameters`` will also be flagged\n * ``#variadic``.\n *\n * @default false\n */\n variadic?: boolean;\n}\n\n/**\n * An initializer.\n */\nexport type Initializer = Callable;\n\n/**\n * A method with a name (i.e: not an initializer).\n */\nexport interface Method extends Callable {\n /**\n * The name of the method. Undefined if this method is a initializer.\n */\n name: string;\n\n /**\n * The return type of the method (`undefined` if `void`)\n *\n * @default void\n */\n returns?: OptionalValue;\n\n /**\n * Is this method an abstract method (this means the class will also be an abstract class)\n *\n * @default false\n */\n abstract?: boolean;\n\n /**\n * Indicates if this is an asynchronous method (it will return a promise).\n *\n * @default false\n */\n async?: boolean;\n\n /**\n * Indicates if this is a static method.\n *\n * @default false\n */\n static?: boolean;\n}\n/**\n * Determines whether a Callable is a Method or not.\n *\n * @param callable the callable to be checked.\n */\nexport function isMethod(callable: Callable): callable is Method {\n return !!(callable as Method).name;\n}\n\n/**\n * Represents a type definition (not a type reference).\n */\nexport type Type = TypeBase & (ClassType | EnumType | InterfaceType);\n\n/**\n * Common attributes of a type definition.\n */\nexport interface TypeBase extends Documentable, SourceLocatable {\n /**\n * The fully qualified name of the type (``..``)\n *\n * @minLength 3\n */\n fqn: FQN;\n\n /**\n * The name of the assembly the type belongs to.\n *\n * @minLength 1\n */\n assembly: string;\n\n /**\n * The namespace of the type (`foo.bar.baz`).\n *\n * When undefined, the type is located at the root of the assembly (its\n * `fqn` would be like `.`).\n *\n * For types inside other types or inside submodules, the `` corresponds to\n * the namespace-qualified name of the container (can contain multiple segments like:\n * `..`).\n *\n * In all cases:\n *\n * = [.].\n *\n * @default none\n */\n namespace?: string;\n\n /**\n * The simple name of the type (MyClass).\n *\n * @minLength 1\n */\n name: string;\n\n /**\n * The kind of the type.\n */\n kind: TypeKind;\n}\n\n/**\n * Kinds of types.\n */\nexport enum TypeKind {\n Class = 'class',\n Enum = 'enum',\n Interface = 'interface',\n}\n\n/**\n * Represents classes.\n */\nexport interface ClassType extends TypeBase {\n kind: TypeKind.Class;\n\n /**\n * The FQN of the base class of this class, if it has one.\n *\n * @default no base class\n */\n base?: FQN;\n\n /**\n * Initializer (constructor) method.\n *\n * @default no initializer\n */\n initializer?: Initializer;\n\n /**\n * List of properties.\n *\n * @default none\n */\n properties?: Property[];\n\n /**\n * List of methods.\n *\n * @default none\n */\n methods?: Method[];\n\n /**\n * Indicates if this class is an abstract class.\n *\n * @default false\n */\n abstract?: boolean;\n\n /**\n * The FQNs of the interfaces this class implements, if any.\n *\n * @default none\n * @uniqueItems true\n */\n interfaces?: FQN[];\n}\n\nexport function isClassType(type: Type | undefined): type is ClassType {\n return type?.kind === TypeKind.Class;\n}\n\nexport interface InterfaceType extends TypeBase {\n kind: TypeKind.Interface;\n\n /**\n * The FQNs of the interfaces this interface extends, if any.\n *\n * @default none\n * @uniqueItems true\n */\n interfaces?: FQN[];\n\n /**\n * List of methods.\n *\n * @default none\n */\n methods?: Method[];\n\n /**\n * List of properties.\n *\n * @default none\n */\n properties?: Property[];\n\n /**\n * True if this interface only contains properties. Different backends might\n * have idiomatic ways to allow defining concrete instances such interfaces.\n * For example, in Java, the generator will produce a PoJo and a builder\n * which will allow users to create a concrete object with data which\n * adheres to this interface.\n *\n * @default false\n */\n datatype?: boolean;\n}\n\nexport function isInterfaceType(type: Type | undefined): type is InterfaceType {\n return type?.kind === TypeKind.Interface;\n}\n\n/**\n * Represents a member of an enum.\n */\nexport interface EnumMember extends Documentable {\n /**\n * The name/symbol of the member.\n */\n name: string;\n}\n\n/**\n * Represents an enum type.\n */\nexport interface EnumType extends TypeBase {\n kind: TypeKind.Enum;\n\n /**\n * Members of the enum.\n */\n members: EnumMember[];\n}\n\nexport function isEnumType(type: Type | undefined): type is EnumType {\n return type?.kind === TypeKind.Enum;\n}\n\n/**\n * Return whether this type is a class or interface type\n */\nexport function isClassOrInterfaceType(\n type: Type | undefined,\n): type is InterfaceType | ClassType {\n return isClassType(type) || isInterfaceType(type);\n}\n\n/**\n * Return a string representation of the given type reference.\n */\nexport function describeTypeReference(type?: TypeReference): string {\n if (type === undefined) {\n return 'void';\n }\n\n if (isNamedTypeReference(type)) {\n return type.fqn;\n }\n\n if (isPrimitiveTypeReference(type)) {\n return type.primitive;\n }\n\n if (isCollectionTypeReference(type)) {\n return `${type.collection.kind}<${describeTypeReference(\n type.collection.elementtype,\n )}>`;\n }\n\n if (isUnionTypeReference(type)) {\n const unionType = type.union.types.map(describeTypeReference).join(' | ');\n return unionType;\n }\n\n throw new Error('Unrecognized type reference');\n}\n\n/**\n * Determines whether an entity is deprecated.\n *\n * @param entity the entity to be checked.\n *\n * @returns true if the entity is marked as deprecated.\n */\nexport function isDeprecated(entity: Documentable): boolean {\n return entity?.docs?.stability === Stability.Deprecated;\n}\n","export * from './assembly';\nexport * from './configuration';\nexport * from './name-tree';\nexport * from './validate-assembly';\n","import * as spec from './assembly';\n\n/**\n * A tree of all names in a module. A node represent a type (terminal)\n * and may represent another node in the namespace (at the same time).\n * Therefore, a key of '_' represents a terminal and references the fqn\n * of the type.\n *\n * For example, say we have the following types:\n * - aws.ec2.Host\n * - aws.ec2.Instance\n * - aws.ec2.Instance.Subtype\n *\n * the the name tree will look like this:\n *\n * module: {\n * children: {\n * aws: {\n * children {\n * ec2: {\n * children: {\n * Host: {\n * fqn: 'aws.ec2.Host',\n * children: {}\n * },\n * Instance: {\n * fqn: 'aws.ec2.Host',\n * children: {\n * Subtype: {\n * fqn: 'aws.ec2.Host.Subtype',\n * children: {}\n * }\n * }\n * }\n * }\n * }\n * }\n * }\n * }\n * }\n */\nexport class NameTree {\n public static of(assm: spec.Assembly): NameTree {\n const nameTree = new NameTree();\n for (const type of Object.values(assm.types ?? {})) {\n nameTree.register(type.fqn);\n }\n return nameTree;\n }\n\n private _children: { [name: string]: NameTree } = {};\n private _fqn?: string;\n\n /* NameTree.of(assembly) should be used. */\n private constructor() {}\n\n /** The children of this node, by name. */\n public get children(): { readonly [name: string]: NameTree } {\n return this._children;\n }\n\n /** The fully qualified name of the type at this node, if there is one. */\n public get fqn(): string | undefined {\n return this._fqn;\n }\n\n /**\n * Adds a type to this ``NameTree``.\n *\n * @param type the type to be added.\n * @param path the path at which to add the node under this tree.\n */\n private register(fqn: string, path: string[] = fqn.split('.')): this {\n if (path.length === 0) {\n this._fqn = fqn;\n } else {\n const [head, ...rest] = path;\n if (!this._children[head]) {\n this._children[head] = new NameTree();\n }\n this._children[head]!.register(fqn, rest);\n }\n return this;\n }\n}\n","import { Schema, Validator } from 'jsonschema';\n\nimport { Assembly } from './assembly';\n\n// eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\nexport const schema: Schema = require('../schema/jsii-spec.schema.json');\n\nexport function validateAssembly(obj: any): Assembly {\n const validator = new Validator();\n validator.addSchema(schema); // For definitions\n const result = validator.validate(obj, schema, { nestedErrors: true } as any); // nestedErrors does exist but is not in the TypeScript definitions\n if (result.valid) {\n return obj;\n }\n throw new Error(`Invalid assembly:\\n${result.toString()}`);\n}\n","module.exports = require(\"assert\");;","module.exports = require(\"buffer\");;","module.exports = require(\"child_process\");;","module.exports = require(\"constants\");;","module.exports = require(\"crypto\");;","module.exports = require(\"events\");;","module.exports = require(\"fs\");;","module.exports = require(\"module\");;","module.exports = require(\"os\");;","module.exports = require(\"path\");;","module.exports = require(\"process\");;","module.exports = require(\"stream\");;","module.exports = require(\"string_decoder\");;","module.exports = require(\"url\");;","module.exports = require(\"util\");;","module.exports = require(\"vm\");;","module.exports = require(\"zlib\");;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","import * as process from 'process';\n\nimport * as packageInfo from '../package.json';\nimport { KernelHost } from './host';\nimport { InputOutput } from './in-out';\nimport { SyncStdio } from './sync-stdio';\n\nconst name = packageInfo.name;\nconst version = packageInfo.version;\n\nconst noStack = !!process.env.JSII_NOSTACK;\nconst debug = !!process.env.JSII_DEBUG;\n\n// This assumes FD#3 is opened for reading and writing. This is normally\n// performed by`bin/jsii-runtime.js`, and we will not be verifying this once\n// again...Meaning that failure to have set this up correctly results in\n// undefined behavior(likely a crash).\nconst stdio = new SyncStdio({\n // \"process.stderr.fd\" is not in @types/node definitions because it can be\n // absent in certain circumstances (for example, in `worker_threads` workers).\n // We'll fall-back to `2` - its expected value - in this case; but this is not\n // supposed to be happening here (we don't use `worker_threads`).\n errorFD: (process.stderr as any).fd ?? 2,\n readFD: 3,\n writeFD: 3,\n});\n\nconst inout = new InputOutput(stdio);\nconst host = new KernelHost(inout, { debug, noStack });\n\nhost.once('exit', process.exit.bind(process));\n\n// say hello\ninout.write({ hello: `${name}@${version}` });\ninout.debug = debug; // we don't want \"hello\" emitted\n\nhost.run();\n"],"sourceRoot":""} \ No newline at end of file diff --git a/internal/kernel/callbacks.go b/internal/kernel/callbacks.go index 320517e..11a5df6 100644 --- a/internal/kernel/callbacks.go +++ b/internal/kernel/callbacks.go @@ -30,6 +30,10 @@ func (c *callback) handle(result kernelResponder) error { return fmt.Errorf("invalid callback object: %v", c) } + if err != nil { + return err + } + type callbackResult struct { CallbackID string `json:"cbid"` Result interface{} `json:"result,omitempty"` @@ -114,8 +118,17 @@ func (c *Client) invoke(method reflect.Value, args []interface{}) (retval reflec err = fmt.Errorf("too many arguments received %d for %d", len(args), numIn) return } - callArgs[i] = reflect.New(argType) - c.CastAndSetToPtr(arg, callArgs[i].Interface()) + if argType.Kind() == reflect.Ptr { + callArgs[i] = reflect.New(argType.Elem()) + } else { + callArgs[i] = reflect.New(argType) + } + c.castAndSetToPtr(callArgs[i].Elem(), reflect.ValueOf(arg)) + if argType.Kind() != reflect.Ptr && argType.Kind() != reflect.Interface { + // The result of `reflect.New` is always a pointer, so if the + // argument is by-value, we have to de-reference it first. + callArgs[i] = callArgs[i].Elem() + } } // Ready to catch an error if the method panics... @@ -136,7 +149,7 @@ func (c *Client) invoke(method reflect.Value, args []interface{}) (retval reflec result := method.Call(callArgs) switch len(result) { case 0: - retval = reflect.ValueOf(nil) + // Nothing to do, retval is already a 0-value. case 1: retval = result[0] default: diff --git a/internal/kernel/client_test.go b/internal/kernel/client_test.go index 9ebb268..19d17b0 100644 --- a/internal/kernel/client_test.go +++ b/internal/kernel/client_test.go @@ -1,9 +1,10 @@ package kernel import ( - "github.com/aws/jsii-runtime-go/internal/typeregistry" "reflect" "testing" + + "github.com/aws/jsii-runtime-go/internal/typeregistry" ) func TestClient(t *testing.T) { diff --git a/internal/kernel/conversions.go b/internal/kernel/conversions.go index 5e6fe0a..1332aea 100644 --- a/internal/kernel/conversions.go +++ b/internal/kernel/conversions.go @@ -26,6 +26,14 @@ func (c *Client) castAndSetToPtr(ptr reflect.Value, data reflect.Value) { // reflect.Value. In such cases, we must craft the correctly-typed zero // value ourselves. data = reflect.Zero(ptr.Type()) + } else if ptr.Kind() == reflect.Ptr && ptr.IsNil() { + // if ptr is a Pointer type and data is valid, initialize a non-nil pointer + // type. Otherwise inner value is not-settable upon recursion. See third + // law of reflection. + // https://blog.golang.org/laws-of-reflection + ptr.Set(reflect.New(ptr.Type().Elem())) + c.castAndSetToPtr(ptr.Elem(), data) + return } else if data.Kind() == reflect.Interface && !data.IsNil() { // If data is a non-nil interface, unwrap it to get it's dynamic value // type sorted out, so that further calls in this method don't have to @@ -77,6 +85,11 @@ func (c *Client) castAndSetToPtr(ptr reflect.Value, data reflect.Value) { return } + if date, isDate := castValToDate(data); isDate { + ptr.Set(reflect.ValueOf(date)) + return + } + // maps if m, isMap := c.castValToMap(data, ptr.Type()); isMap { ptr.Set(m) @@ -104,6 +117,11 @@ func (c *Client) castAndSetToPtr(ptr reflect.Value, data reflect.Value) { // objref for the runtime. Recursively casts types that may contain nested // object references. func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{} { + if !dataVal.IsValid() { + // dataVal is a 0-value, meaning we have no value available... We return + // this to JavaScript as a "null" value. + return nil + } if (dataVal.Kind() == reflect.Interface || dataVal.Kind() == reflect.Ptr) && dataVal.IsNil() { return nil } @@ -131,30 +149,32 @@ func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{} { return c.CastPtrToRef(elem) } - if ref, err := c.ManageObject(dataVal); err != nil { - panic(err) - } else { - return ref - } + if dataVal.Elem().Kind() == reflect.Struct { + elemVal := dataVal.Elem() + if fields, fqn, isStruct := c.Types().StructFields(elemVal.Type()); isStruct { + data := make(map[string]interface{}) + for _, field := range fields { + fieldVal := elemVal.FieldByIndex(field.Index) + if (fieldVal.Kind() == reflect.Ptr || fieldVal.Kind() == reflect.Interface) && fieldVal.IsNil() { + continue + } + key := field.Tag.Get("json") + data[key] = c.CastPtrToRef(fieldVal) + } - case reflect.Struct: - if fields, fqn, isStruct := c.Types().StructFields(dataVal.Type()); isStruct { - data := make(map[string]interface{}) - for _, field := range fields { - fieldVal := dataVal.FieldByIndex(field.Index) - if (fieldVal.Kind() == reflect.Ptr || fieldVal.Kind() == reflect.Interface) && fieldVal.IsNil() { - continue + return api.WireStruct{ + StructDescriptor: api.StructDescriptor{ + FQN: fqn, + Fields: data, + }, } - key := field.Tag.Get("json") - data[key] = c.CastPtrToRef(fieldVal) } + } - return api.WireStruct{ - StructDescriptor: api.StructDescriptor{ - FQN: fqn, - Fields: data, - }, - } + if ref, err := c.ManageObject(dataVal); err != nil { + panic(err) + } else { + return ref } case reflect.Slice: @@ -172,19 +192,39 @@ func (c *Client) CastPtrToRef(dataVal reflect.Value) interface{} { return dataVal.Interface() } -func castValToRef(data reflect.Value) (api.ObjectRef, bool) { - ref := api.ObjectRef{} - ok := false - +func castValToRef(data reflect.Value) (ref api.ObjectRef, ok bool) { if data.Kind() == reflect.Map { for _, k := range data.MapKeys() { // Finding values type requires extracting from reflect.Value // otherwise .Kind() returns `interface{}` v := reflect.ValueOf(data.MapIndex(k).Interface()) - if k.Kind() == reflect.String && k.String() == "$jsii.byref" && v.Kind() == reflect.String { + if k.Kind() != reflect.String { + continue + } + + switch k.String() { + case "$jsii.byref": + if v.Kind() != reflect.String { + ok = false + return + } ref.InstanceID = v.String() ok = true + case "$jsii.interfaces": + if v.Kind() != reflect.Slice { + continue + } + ifaces := make([]api.FQN, v.Len()) + for i := 0; i < v.Len(); i++ { + e := reflect.ValueOf(v.Index(i).Interface()) + if e.Kind() != reflect.String { + ok = false + return + } + ifaces[i] = api.FQN(e.String()) + } + ref.Interfaces = ifaces } } @@ -193,6 +233,22 @@ func castValToRef(data reflect.Value) (api.ObjectRef, bool) { return ref, ok } +// TODO: This should return a time.Time instead +func castValToDate(data reflect.Value) (date string, ok bool) { + if data.Kind() == reflect.Map { + for _, k := range data.MapKeys() { + v := reflect.ValueOf(data.MapIndex(k).Interface()) + if k.Kind() == reflect.String && k.String() == "$jsii.date" && v.Kind() == reflect.String { + date = v.String() + ok = true + break + } + } + } + + return +} + func castValToEnumRef(data reflect.Value) (enum api.EnumRef, ok bool) { ok = false @@ -205,7 +261,7 @@ func castValToEnumRef(data reflect.Value) (enum api.EnumRef, ok bool) { if k.Kind() == reflect.String && k.String() == "$jsii.enum" && v.Kind() == reflect.String { enum.MemberFQN = v.String() ok = true - return + break } } } diff --git a/internal/kernel/create.go b/internal/kernel/create.go index e666dba..65503c2 100644 --- a/internal/kernel/create.go +++ b/internal/kernel/create.go @@ -4,9 +4,9 @@ import "github.com/aws/jsii-runtime-go/internal/api" type CreateProps struct { FQN api.FQN `json:"fqn"` - Interfaces []api.FQN `json:"interfaces"` - Arguments []interface{} `json:"args"` - Overrides []api.Override `json:"overrides"` + Interfaces []api.FQN `json:"interfaces,omitempty"` + Arguments []interface{} `json:"args,omitempty"` + Overrides []api.Override `json:"overrides,omitempty"` } // TODO extends AnnotatedObjRef? diff --git a/internal/kernel/manage-object.go b/internal/kernel/manage-object.go index fb5f46b..c755c83 100644 --- a/internal/kernel/manage-object.go +++ b/internal/kernel/manage-object.go @@ -10,7 +10,12 @@ const objectFQN = "Object" func (c *Client) ManageObject(v reflect.Value) (ref api.ObjectRef, err error) { // Ensuring we use a pointer, so we can see pointer-receiver methods, too. - vt := reflect.Indirect(v).Addr().Type() + var vt reflect.Type + if v.Kind() == reflect.Interface || (v.Kind() == reflect.Ptr && v.Elem().Kind() == reflect.Interface) { + vt = reflect.Indirect(reflect.ValueOf(v.Interface())).Addr().Type() + } else { + vt = reflect.Indirect(v).Addr().Type() + } interfaces, overrides := c.Types().DiscoverImplementation(vt) var resp CreateResponse diff --git a/internal/kernel/version.generated.go b/internal/kernel/version.generated.go index aa23617..6af4fa8 100644 --- a/internal/kernel/version.generated.go +++ b/internal/kernel/version.generated.go @@ -1,3 +1,3 @@ package kernel -const version = "1.25.0" +const version = "1.26.0" diff --git a/internal/objectstore/objectstore.go b/internal/objectstore/objectstore.go index 492ce5c..6944056 100644 --- a/internal/objectstore/objectstore.go +++ b/internal/objectstore/objectstore.go @@ -53,20 +53,25 @@ func (o *ObjectStore) Register(value reflect.Value, instanceID string) error { if existing == instanceID { return nil } - return fmt.Errorf("attempting to register %v as %s, but it was already registered as %s", value, instanceID, existing) + return fmt.Errorf("attempting to register %s as %s, but it was already registered as %s", value, instanceID, existing) } + + aliases := findAliases(value) + if existing, found := o.idToObject[instanceID]; found { if existing == value { return nil } - return fmt.Errorf("attempted to register %v as %s, but %v has this ID", value, instanceID, existing) + // Value already exists (e.g: a constructor made a callback with "this" + // passed as an argument). We make the current value an alias of the new + // one. + aliases = append(aliases, existing) } - aliases := findAliases(value) for _, alias := range aliases { ptr := alias.Pointer() if existing, found := o.objectToID[ptr]; found && existing != instanceID { - return fmt.Errorf("value %s is embedded in %s which has ID %s, but was already assigned %s", alias, value, instanceID, existing) + return fmt.Errorf("value %s is embedded in %s which has ID %s, but was already assigned %s", alias.String(), value.String(), instanceID, existing) } } @@ -131,7 +136,7 @@ func canonicalValue(value reflect.Value) (reflect.Value, error) { // a nil value, or a value that is not ultimately a reflect.Struct may result // in panic. func findAliases(value reflect.Value) []reflect.Value { - result := []reflect.Value{} + var result []reflect.Value // Indirect so we always work on the pointer referree value = reflect.Indirect(value) diff --git a/internal/typeregistry/discover-implemented.go b/internal/typeregistry/discover-implemented.go index 8ff7858..84368b8 100644 --- a/internal/typeregistry/discover-implemented.go +++ b/internal/typeregistry/discover-implemented.go @@ -2,6 +2,7 @@ package typeregistry import ( "reflect" + "strings" "github.com/aws/jsii-runtime-go/internal/api" ) @@ -10,25 +11,32 @@ import ( // implemented by the provided type, and returns the list of their FQNs and // overrides for all their combined methods and properties. func (t *TypeRegistry) DiscoverImplementation(vt reflect.Type) (interfaces []api.FQN, overrides []api.Override) { + if strings.HasPrefix(vt.Name(), "jsiiProxy_") { + return + } + registeredOverrides := make(map[string]bool) + embeds := t.registeredBasesOf(vt) + pt := reflect.PtrTo(vt) + +OuterLoop: for fqn, members := range t.typeMembers { iface := t.fqnToType[fqn] - if iface.Kind == classType || !vt.AssignableTo(iface.Type) { + if iface.Kind == classType || !(vt.AssignableTo(iface.Type) || pt.AssignableTo(iface.Type)) { continue } + for _, embed := range embeds { + if embed.AssignableTo(iface.Type) { + continue OuterLoop + } + } // Found a hit, registering it's FQN in the list! interfaces = append(interfaces, fqn) // Now, collecting all members thereof for _, override := range members { - var identifier string - if api.IsMethodOverride(override) { - identifier = override.(api.MethodOverride).GoMethod - } else { - identifier = override.(api.PropertyOverride).GoGetter - } - if !registeredOverrides[identifier] { + if identifier := override.GoName(); !registeredOverrides[identifier] { registeredOverrides[identifier] = true overrides = append(overrides, override) } @@ -37,3 +45,27 @@ func (t *TypeRegistry) DiscoverImplementation(vt reflect.Type) (interfaces []api return } + +// registeredBasesOf looks for known base type anonymously embedded (not +// recursively) in the given value type. Interfaces implemented by those types +// are actually not "additional interfaces" (they are implied). +func (t *TypeRegistry) registeredBasesOf(vt reflect.Type) []reflect.Type { + if vt.Kind() == reflect.Ptr { + vt = vt.Elem() + } + if vt.Kind() != reflect.Struct { + return nil + } + n := vt.NumField() + result := make([]reflect.Type, 0, n) + for i := 0; i < n; i++ { + f := vt.Field(i) + if !f.Anonymous { + continue + } + if _, ok := t.proxyMakers[f.Type]; ok { + result = append(result, f.Type) + } + } + return result +} diff --git a/internal/typeregistry/overrides.go b/internal/typeregistry/overrides.go new file mode 100644 index 0000000..5358d31 --- /dev/null +++ b/internal/typeregistry/overrides.go @@ -0,0 +1,17 @@ +package typeregistry + +import ( + "github.com/aws/jsii-runtime-go/internal/api" +) + +func (t *TypeRegistry) GetOverride(fqn api.FQN, n string) (api.Override, bool) { + if members, ok := t.typeMembers[fqn]; ok { + for _, member := range members { + if member.GoName() == n { + return member, true + } + } + } + + return nil, false +} diff --git a/internal/typeregistry/registration.go b/internal/typeregistry/registration.go index f0d7726..aab2ab3 100644 --- a/internal/typeregistry/registration.go +++ b/internal/typeregistry/registration.go @@ -44,7 +44,8 @@ func (t *TypeRegistry) RegisterClass(fqn api.FQN, class reflect.Type, overrides // Skipping registration if there are no members, as this would have no use. if len(overrides) > 0 { - t.typeMembers[fqn] = append([]api.Override{}, overrides...) + t.typeMembers[fqn] = make([]api.Override, len(overrides)) + copy(t.typeMembers[fqn], overrides) } return nil @@ -100,7 +101,8 @@ func (t *TypeRegistry) RegisterInterface(fqn api.FQN, iface reflect.Type, overri // Skipping registration if there are no members, as this would have no use. if len(overrides) > 0 { - t.typeMembers[fqn] = append([]api.Override{}, overrides...) + t.typeMembers[fqn] = make([]api.Override, len(overrides)) + copy(t.typeMembers[fqn], overrides) } return nil @@ -118,8 +120,12 @@ func (t *TypeRegistry) RegisterStruct(fqn api.FQN, strct reflect.Type) error { return fmt.Errorf("another type was already registered with %s: %v", fqn, existing) } - fields := []reflect.StructField{} + if existing, exists := t.structInfo[strct]; exists && existing.FQN != fqn { + return fmt.Errorf("attempting to register type %s as %s, but it was already registered as: %s", strct.String(), fqn, existing.FQN) + } + numField := strct.NumField() + fields := make([]reflect.StructField, 0, numField) for i := 0; i < numField; i++ { field := strct.Field(i) if field.Anonymous { diff --git a/internal/typeregistry/typeregistry.go b/internal/typeregistry/typeregistry.go index b57738e..50d969e 100644 --- a/internal/typeregistry/typeregistry.go +++ b/internal/typeregistry/typeregistry.go @@ -57,8 +57,19 @@ func (t *TypeRegistry) StructFields(typ reflect.Type) (fields []reflect.StructFi if info, ok = t.structInfo[typ]; !ok { return } + fqn = info.FQN - fields = append(fields, info.Fields...) + fields = make([]reflect.StructField, len(info.Fields)) + copy(fields, info.Fields) + return +} + +// FindType returns the registered type corresponding to the provided jsii FQN. +func (t *TypeRegistry) FindType(fqn api.FQN) (typ reflect.Type, ok bool) { + var reg registeredType + if reg, ok = t.fqnToType[fqn]; ok { + typ = reg.Type + } return } diff --git a/runtime.go b/runtime.go index f40bf5c..19ed072 100644 --- a/runtime.go +++ b/runtime.go @@ -3,6 +3,7 @@ package jsii import ( "fmt" "reflect" + "strings" "github.com/aws/jsii-runtime-go/internal/api" "github.com/aws/jsii-runtime-go/internal/kernel" @@ -61,7 +62,7 @@ func RegisterClass(fqn FQN, class reflect.Type, members []Member, maker func() i // RegisterEnum associates an enum's fully qualified name to the specified enum // type, and members. Panics if enum is not a reflect.String type, any value in -// the provided members map is of a type ofther than enum, or if the provided +// the provided members map is of a type other than enum, or if the provided // fqn was already used to register a different type. func RegisterEnum(fqn FQN, enum reflect.Type, members map[string]interface{}) { client := kernel.GetClient() @@ -108,9 +109,11 @@ func InitJsiiProxy(ptr interface{}) { // Create will construct a new JSII object within the kernel runtime. This is // called by jsii object constructors. -func Create(fqn FQN, args []interface{}, interfaces []FQN, overriddenMembers []Member, inst interface{}) { +func Create(fqn FQN, args []interface{}, inst interface{}) { client := kernel.GetClient() + var overrides []api.Override + instVal := reflect.ValueOf(inst) structVal := instVal.Elem() instType := structVal.Type() @@ -130,6 +133,20 @@ func Create(fqn FQN, args []interface{}, interfaces []FQN, overriddenMembers []M panic(err) } + if tag := field.Tag.Get("overrides"); tag != "" { + if names := strings.Split(tag, ","); len(names) > 0 { + overrides = make([]api.Override, len(names)) + registry := client.Types() + for i, name := range names { + if override, ok := registry.GetOverride(api.FQN(fqn), name); !ok { + panic(fmt.Errorf("unable to identify method or property for override %s declared by %v", name, field)) + } else { + overrides[i] = override + } + } + } + } + case reflect.Struct: fieldVal := structVal.Field(i) if !fieldVal.IsZero() { @@ -141,19 +158,13 @@ func Create(fqn FQN, args []interface{}, interfaces []FQN, overriddenMembers []M } } - var interfaceFQNs []api.FQN - for _, iface := range interfaces { - interfaceFQNs = append(interfaceFQNs, api.FQN(iface)) - } - overrides := make([]api.Override, len(overriddenMembers)) - for i, member := range overriddenMembers { - overrides[i] = member.toOverride() - } + interfaces, newOverrides := client.Types().DiscoverImplementation(instType) + overrides = append(overrides, newOverrides...) res, err := client.Create(kernel.CreateProps{ FQN: api.FQN(fqn), Arguments: convertArguments(args), - Interfaces: interfaceFQNs, + Interfaces: interfaces, Overrides: overrides, }) @@ -336,10 +347,10 @@ func StaticSet(fqn FQN, property string, value interface{}) { // ready for inclusion in an invoke or create request. func convertArguments(args []interface{}) []interface{} { if len(args) == 0 { - return make([]interface{}, 0, 0) + return nil } - result := make([]interface{}, len(args), len(args)) + result := make([]interface{}, len(args)) client := kernel.GetClient() for i, arg := range args { val := reflect.ValueOf(arg) @@ -359,3 +370,8 @@ func convertArguments(args []interface{}) []interface{} { func Close() { kernel.CloseClient() } + +// Helpers to store primitives and return pointers to them +func Bool(v bool) *bool { return &v } +func Number(v float64) *float64 { return &v } +func String(v string) *string { return &v } diff --git a/version b/version index ad21919..5ff8c4f 100644 --- a/version +++ b/version @@ -1 +1 @@ -1.25.0 +1.26.0