@wecode-ai/weibo-openclaw-plugin 2.1.4 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -1
- package/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
- package/node_modules/@isaacs/fs-minipass/README.md +71 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts +118 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts +118 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/index.js.map +1 -0
- package/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
- package/node_modules/@isaacs/fs-minipass/package.json +72 -0
- package/node_modules/chownr/LICENSE.md +63 -0
- package/node_modules/chownr/README.md +3 -0
- package/node_modules/chownr/dist/commonjs/index.d.ts +3 -0
- package/node_modules/chownr/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/chownr/dist/commonjs/index.js +93 -0
- package/node_modules/chownr/dist/commonjs/index.js.map +1 -0
- package/node_modules/chownr/dist/commonjs/package.json +3 -0
- package/node_modules/chownr/dist/esm/index.d.ts +3 -0
- package/node_modules/chownr/dist/esm/index.d.ts.map +1 -0
- package/node_modules/chownr/dist/esm/index.js +85 -0
- package/node_modules/chownr/dist/esm/index.js.map +1 -0
- package/node_modules/chownr/dist/esm/package.json +3 -0
- package/node_modules/chownr/package.json +69 -0
- package/node_modules/minipass/LICENSE.md +55 -0
- package/node_modules/minipass/README.md +825 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts +545 -0
- package/node_modules/minipass/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/commonjs/index.js +1038 -0
- package/node_modules/minipass/dist/commonjs/index.js.map +1 -0
- package/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/node_modules/minipass/dist/esm/index.d.ts +545 -0
- package/node_modules/minipass/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minipass/dist/esm/index.js +1020 -0
- package/node_modules/minipass/dist/esm/index.js.map +1 -0
- package/node_modules/minipass/dist/esm/package.json +3 -0
- package/node_modules/minipass/package.json +77 -0
- package/node_modules/minizlib/LICENSE +26 -0
- package/node_modules/minizlib/README.md +64 -0
- package/node_modules/minizlib/dist/commonjs/constants.d.ts +2 -0
- package/node_modules/minizlib/dist/commonjs/constants.d.ts.map +1 -0
- package/node_modules/minizlib/dist/commonjs/constants.js +123 -0
- package/node_modules/minizlib/dist/commonjs/constants.js.map +1 -0
- package/node_modules/minizlib/dist/commonjs/index.d.ts +99 -0
- package/node_modules/minizlib/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/minizlib/dist/commonjs/index.js +416 -0
- package/node_modules/minizlib/dist/commonjs/index.js.map +1 -0
- package/node_modules/minizlib/dist/commonjs/package.json +3 -0
- package/node_modules/minizlib/dist/esm/constants.d.ts +2 -0
- package/node_modules/minizlib/dist/esm/constants.d.ts.map +1 -0
- package/node_modules/minizlib/dist/esm/constants.js +117 -0
- package/node_modules/minizlib/dist/esm/constants.js.map +1 -0
- package/node_modules/minizlib/dist/esm/index.d.ts +99 -0
- package/node_modules/minizlib/dist/esm/index.d.ts.map +1 -0
- package/node_modules/minizlib/dist/esm/index.js +363 -0
- package/node_modules/minizlib/dist/esm/index.js.map +1 -0
- package/node_modules/minizlib/dist/esm/package.json +3 -0
- package/node_modules/minizlib/package.json +80 -0
- package/node_modules/tar/LICENSE.md +55 -0
- package/node_modules/tar/README.md +1224 -0
- package/node_modules/tar/dist/commonjs/create.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/create.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/create.js +82 -0
- package/node_modules/tar/dist/commonjs/create.js.map +1 -0
- package/node_modules/tar/dist/commonjs/cwd-error.d.ts +8 -0
- package/node_modules/tar/dist/commonjs/cwd-error.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
- package/node_modules/tar/dist/commonjs/cwd-error.js.map +1 -0
- package/node_modules/tar/dist/commonjs/extract.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/extract.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/extract.js +88 -0
- package/node_modules/tar/dist/commonjs/extract.js.map +1 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
- package/node_modules/tar/dist/commonjs/get-write-flag.js.map +1 -0
- package/node_modules/tar/dist/commonjs/header.d.ts +53 -0
- package/node_modules/tar/dist/commonjs/header.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/header.js +312 -0
- package/node_modules/tar/dist/commonjs/header.js.map +1 -0
- package/node_modules/tar/dist/commonjs/index.d.ts +20 -0
- package/node_modules/tar/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/index.js +64 -0
- package/node_modules/tar/dist/commonjs/index.js.map +1 -0
- package/node_modules/tar/dist/commonjs/index.min.js +4 -0
- package/node_modules/tar/dist/commonjs/index.min.js.map +7 -0
- package/node_modules/tar/dist/commonjs/large-numbers.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/large-numbers.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
- package/node_modules/tar/dist/commonjs/large-numbers.js.map +1 -0
- package/node_modules/tar/dist/commonjs/list.d.ts +7 -0
- package/node_modules/tar/dist/commonjs/list.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/list.js +145 -0
- package/node_modules/tar/dist/commonjs/list.js.map +1 -0
- package/node_modules/tar/dist/commonjs/make-command.d.ts +49 -0
- package/node_modules/tar/dist/commonjs/make-command.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/make-command.js +52 -0
- package/node_modules/tar/dist/commonjs/make-command.js.map +1 -0
- package/node_modules/tar/dist/commonjs/mkdir.d.ts +25 -0
- package/node_modules/tar/dist/commonjs/mkdir.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/mkdir.js +187 -0
- package/node_modules/tar/dist/commonjs/mkdir.js.map +1 -0
- package/node_modules/tar/dist/commonjs/mode-fix.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/mode-fix.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
- package/node_modules/tar/dist/commonjs/mode-fix.js.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
- package/node_modules/tar/dist/commonjs/normalize-unicode.js.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
- package/node_modules/tar/dist/commonjs/normalize-windows-path.js.map +1 -0
- package/node_modules/tar/dist/commonjs/options.d.ts +596 -0
- package/node_modules/tar/dist/commonjs/options.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/options.js +66 -0
- package/node_modules/tar/dist/commonjs/options.js.map +1 -0
- package/node_modules/tar/dist/commonjs/pack.d.ts +102 -0
- package/node_modules/tar/dist/commonjs/pack.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/pack.js +511 -0
- package/node_modules/tar/dist/commonjs/pack.js.map +1 -0
- package/node_modules/tar/dist/commonjs/package.json +3 -0
- package/node_modules/tar/dist/commonjs/parse.d.ts +85 -0
- package/node_modules/tar/dist/commonjs/parse.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/parse.js +610 -0
- package/node_modules/tar/dist/commonjs/parse.js.map +1 -0
- package/node_modules/tar/dist/commonjs/path-reservations.d.ts +11 -0
- package/node_modules/tar/dist/commonjs/path-reservations.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
- package/node_modules/tar/dist/commonjs/path-reservations.js.map +1 -0
- package/node_modules/tar/dist/commonjs/pax.d.ts +26 -0
- package/node_modules/tar/dist/commonjs/pax.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/pax.js +158 -0
- package/node_modules/tar/dist/commonjs/pax.js.map +1 -0
- package/node_modules/tar/dist/commonjs/process-umask.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/process-umask.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/process-umask.js +7 -0
- package/node_modules/tar/dist/commonjs/process-umask.js.map +1 -0
- package/node_modules/tar/dist/commonjs/read-entry.d.ts +36 -0
- package/node_modules/tar/dist/commonjs/read-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/read-entry.js +136 -0
- package/node_modules/tar/dist/commonjs/read-entry.js.map +1 -0
- package/node_modules/tar/dist/commonjs/replace.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/replace.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/replace.js +227 -0
- package/node_modules/tar/dist/commonjs/replace.js.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
- package/node_modules/tar/dist/commonjs/strip-absolute-path.js.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
- package/node_modules/tar/dist/commonjs/strip-trailing-slashes.js.map +1 -0
- package/node_modules/tar/dist/commonjs/symlink-error.d.ts +9 -0
- package/node_modules/tar/dist/commonjs/symlink-error.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
- package/node_modules/tar/dist/commonjs/symlink-error.js.map +1 -0
- package/node_modules/tar/dist/commonjs/types.d.ts +7 -0
- package/node_modules/tar/dist/commonjs/types.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/types.js +50 -0
- package/node_modules/tar/dist/commonjs/types.js.map +1 -0
- package/node_modules/tar/dist/commonjs/unpack.d.ts +101 -0
- package/node_modules/tar/dist/commonjs/unpack.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/unpack.js +932 -0
- package/node_modules/tar/dist/commonjs/unpack.js.map +1 -0
- package/node_modules/tar/dist/commonjs/update.d.ts +2 -0
- package/node_modules/tar/dist/commonjs/update.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/update.js +33 -0
- package/node_modules/tar/dist/commonjs/update.js.map +1 -0
- package/node_modules/tar/dist/commonjs/warn-method.d.ts +24 -0
- package/node_modules/tar/dist/commonjs/warn-method.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/warn-method.js +31 -0
- package/node_modules/tar/dist/commonjs/warn-method.js.map +1 -0
- package/node_modules/tar/dist/commonjs/winchars.d.ts +3 -0
- package/node_modules/tar/dist/commonjs/winchars.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/winchars.js +14 -0
- package/node_modules/tar/dist/commonjs/winchars.js.map +1 -0
- package/node_modules/tar/dist/commonjs/write-entry.d.ts +129 -0
- package/node_modules/tar/dist/commonjs/write-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/commonjs/write-entry.js +698 -0
- package/node_modules/tar/dist/commonjs/write-entry.js.map +1 -0
- package/node_modules/tar/dist/esm/create.d.ts +3 -0
- package/node_modules/tar/dist/esm/create.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/create.js +76 -0
- package/node_modules/tar/dist/esm/create.js.map +1 -0
- package/node_modules/tar/dist/esm/cwd-error.d.ts +8 -0
- package/node_modules/tar/dist/esm/cwd-error.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/cwd-error.js +14 -0
- package/node_modules/tar/dist/esm/cwd-error.js.map +1 -0
- package/node_modules/tar/dist/esm/extract.d.ts +3 -0
- package/node_modules/tar/dist/esm/extract.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/extract.js +49 -0
- package/node_modules/tar/dist/esm/extract.js.map +1 -0
- package/node_modules/tar/dist/esm/get-write-flag.d.ts +2 -0
- package/node_modules/tar/dist/esm/get-write-flag.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/get-write-flag.js +26 -0
- package/node_modules/tar/dist/esm/get-write-flag.js.map +1 -0
- package/node_modules/tar/dist/esm/header.d.ts +53 -0
- package/node_modules/tar/dist/esm/header.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/header.js +275 -0
- package/node_modules/tar/dist/esm/header.js.map +1 -0
- package/node_modules/tar/dist/esm/index.d.ts +20 -0
- package/node_modules/tar/dist/esm/index.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/index.js +20 -0
- package/node_modules/tar/dist/esm/index.js.map +1 -0
- package/node_modules/tar/dist/esm/index.min.js +4 -0
- package/node_modules/tar/dist/esm/index.min.js.map +7 -0
- package/node_modules/tar/dist/esm/large-numbers.d.ts +3 -0
- package/node_modules/tar/dist/esm/large-numbers.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/large-numbers.js +94 -0
- package/node_modules/tar/dist/esm/large-numbers.js.map +1 -0
- package/node_modules/tar/dist/esm/list.d.ts +7 -0
- package/node_modules/tar/dist/esm/list.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/list.js +105 -0
- package/node_modules/tar/dist/esm/list.js.map +1 -0
- package/node_modules/tar/dist/esm/make-command.d.ts +49 -0
- package/node_modules/tar/dist/esm/make-command.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/make-command.js +48 -0
- package/node_modules/tar/dist/esm/make-command.js.map +1 -0
- package/node_modules/tar/dist/esm/mkdir.d.ts +25 -0
- package/node_modules/tar/dist/esm/mkdir.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/mkdir.js +179 -0
- package/node_modules/tar/dist/esm/mkdir.js.map +1 -0
- package/node_modules/tar/dist/esm/mode-fix.d.ts +2 -0
- package/node_modules/tar/dist/esm/mode-fix.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/mode-fix.js +25 -0
- package/node_modules/tar/dist/esm/mode-fix.js.map +1 -0
- package/node_modules/tar/dist/esm/normalize-unicode.d.ts +2 -0
- package/node_modules/tar/dist/esm/normalize-unicode.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
- package/node_modules/tar/dist/esm/normalize-unicode.js.map +1 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.d.ts +2 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
- package/node_modules/tar/dist/esm/normalize-windows-path.js.map +1 -0
- package/node_modules/tar/dist/esm/options.d.ts +596 -0
- package/node_modules/tar/dist/esm/options.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/options.js +54 -0
- package/node_modules/tar/dist/esm/options.js.map +1 -0
- package/node_modules/tar/dist/esm/pack.d.ts +102 -0
- package/node_modules/tar/dist/esm/pack.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/pack.js +469 -0
- package/node_modules/tar/dist/esm/pack.js.map +1 -0
- package/node_modules/tar/dist/esm/package.json +3 -0
- package/node_modules/tar/dist/esm/parse.d.ts +85 -0
- package/node_modules/tar/dist/esm/parse.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/parse.js +606 -0
- package/node_modules/tar/dist/esm/parse.js.map +1 -0
- package/node_modules/tar/dist/esm/path-reservations.d.ts +11 -0
- package/node_modules/tar/dist/esm/path-reservations.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/path-reservations.js +166 -0
- package/node_modules/tar/dist/esm/path-reservations.js.map +1 -0
- package/node_modules/tar/dist/esm/pax.d.ts +26 -0
- package/node_modules/tar/dist/esm/pax.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/pax.js +154 -0
- package/node_modules/tar/dist/esm/pax.js.map +1 -0
- package/node_modules/tar/dist/esm/process-umask.d.ts +2 -0
- package/node_modules/tar/dist/esm/process-umask.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/process-umask.js +3 -0
- package/node_modules/tar/dist/esm/process-umask.js.map +1 -0
- package/node_modules/tar/dist/esm/read-entry.d.ts +36 -0
- package/node_modules/tar/dist/esm/read-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/read-entry.js +132 -0
- package/node_modules/tar/dist/esm/read-entry.js.map +1 -0
- package/node_modules/tar/dist/esm/replace.d.ts +2 -0
- package/node_modules/tar/dist/esm/replace.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/replace.js +221 -0
- package/node_modules/tar/dist/esm/replace.js.map +1 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.d.ts +2 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
- package/node_modules/tar/dist/esm/strip-absolute-path.js.map +1 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts +2 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
- package/node_modules/tar/dist/esm/strip-trailing-slashes.js.map +1 -0
- package/node_modules/tar/dist/esm/symlink-error.d.ts +9 -0
- package/node_modules/tar/dist/esm/symlink-error.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/symlink-error.js +15 -0
- package/node_modules/tar/dist/esm/symlink-error.js.map +1 -0
- package/node_modules/tar/dist/esm/types.d.ts +7 -0
- package/node_modules/tar/dist/esm/types.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/types.js +45 -0
- package/node_modules/tar/dist/esm/types.js.map +1 -0
- package/node_modules/tar/dist/esm/unpack.d.ts +101 -0
- package/node_modules/tar/dist/esm/unpack.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/unpack.js +891 -0
- package/node_modules/tar/dist/esm/unpack.js.map +1 -0
- package/node_modules/tar/dist/esm/update.d.ts +2 -0
- package/node_modules/tar/dist/esm/update.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/update.js +30 -0
- package/node_modules/tar/dist/esm/update.js.map +1 -0
- package/node_modules/tar/dist/esm/warn-method.d.ts +24 -0
- package/node_modules/tar/dist/esm/warn-method.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/warn-method.js +27 -0
- package/node_modules/tar/dist/esm/warn-method.js.map +1 -0
- package/node_modules/tar/dist/esm/winchars.d.ts +3 -0
- package/node_modules/tar/dist/esm/winchars.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/winchars.js +9 -0
- package/node_modules/tar/dist/esm/winchars.js.map +1 -0
- package/node_modules/tar/dist/esm/write-entry.d.ts +129 -0
- package/node_modules/tar/dist/esm/write-entry.d.ts.map +1 -0
- package/node_modules/tar/dist/esm/write-entry.js +656 -0
- package/node_modules/tar/dist/esm/write-entry.js.map +1 -0
- package/node_modules/tar/package.json +297 -0
- package/node_modules/yallist/LICENSE.md +63 -0
- package/node_modules/yallist/README.md +205 -0
- package/node_modules/yallist/dist/commonjs/index.d.ts +39 -0
- package/node_modules/yallist/dist/commonjs/index.d.ts.map +1 -0
- package/node_modules/yallist/dist/commonjs/index.js +384 -0
- package/node_modules/yallist/dist/commonjs/index.js.map +1 -0
- package/node_modules/yallist/dist/commonjs/package.json +3 -0
- package/node_modules/yallist/dist/esm/index.d.ts +39 -0
- package/node_modules/yallist/dist/esm/index.d.ts.map +1 -0
- package/node_modules/yallist/dist/esm/index.js +379 -0
- package/node_modules/yallist/dist/esm/index.js.map +1 -0
- package/node_modules/yallist/dist/esm/package.json +3 -0
- package/node_modules/yallist/package.json +68 -0
- package/package.json +3 -1
- package/skills/manifest.json +12 -0
- package/skills/weibo-cron/SKILL.md +115 -48
- package/skills/weibo-crowd/SKILL.md +182 -16
- package/skills/weibo-crowd/references/SILICON-TEAHOUSE-RULES.md +196 -62
- package/skills/weibo-crowd/scripts/weibo-crowd.js +105 -27
- package/skills/weibo-hot-search/SKILL.md +2 -0
- package/skills/weibo-pic/SKILL.md +266 -0
- package/skills/weibo-pic/scripts/weibo-pic.js +798 -0
- package/skills/weibo-search/SKILL.md +2 -0
- package/skills/weibo-status/SKILL.md +2 -0
- package/skills/weibo-token/SKILL.md +2 -0
- package/skills/weibo-video/SKILL.md +2 -0
- package/src/client.d.ts.map +1 -1
- package/src/client.js +3 -0
- package/src/client.js.map +1 -1
- package/src/skill-updater.d.ts +14 -0
- package/src/skill-updater.d.ts.map +1 -0
- package/src/skill-updater.js +240 -0
- package/src/skill-updater.js.map +1 -0
- package/src/token.d.ts +2 -0
- package/src/token.d.ts.map +1 -1
- package/src/token.js +1 -0
- package/src/token.js.map +1 -1
- package/src/weibo-hot-search.js +1 -1
- package/src/weibo-hot-search.js.map +1 -1
- package/src/weibo-search.js +1 -1
- package/src/weibo-search.js.map +1 -1
- package/src/weibo-status.js +1 -1
- package/src/weibo-status.js.map +1 -1
- package/src/weibo-token-tool.js +1 -1
- package/src/weibo-token-tool.js.map +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.d.ts","sourceRoot":"","sources":["../../src/create.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AA0E1C,eAAO,MAAM,MAAM,wDAUlB,CAAA"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.create = void 0;
|
|
7
|
+
const fs_minipass_1 = require("@isaacs/fs-minipass");
|
|
8
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
9
|
+
const list_js_1 = require("./list.js");
|
|
10
|
+
const make_command_js_1 = require("./make-command.js");
|
|
11
|
+
const pack_js_1 = require("./pack.js");
|
|
12
|
+
const createFileSync = (opt, files) => {
|
|
13
|
+
const p = new pack_js_1.PackSync(opt);
|
|
14
|
+
const stream = new fs_minipass_1.WriteStreamSync(opt.file, {
|
|
15
|
+
mode: opt.mode || 0o666,
|
|
16
|
+
});
|
|
17
|
+
p.pipe(stream);
|
|
18
|
+
addFilesSync(p, files);
|
|
19
|
+
};
|
|
20
|
+
const createFile = (opt, files) => {
|
|
21
|
+
const p = new pack_js_1.Pack(opt);
|
|
22
|
+
const stream = new fs_minipass_1.WriteStream(opt.file, {
|
|
23
|
+
mode: opt.mode || 0o666,
|
|
24
|
+
});
|
|
25
|
+
p.pipe(stream);
|
|
26
|
+
const promise = new Promise((res, rej) => {
|
|
27
|
+
stream.on('error', rej);
|
|
28
|
+
stream.on('close', res);
|
|
29
|
+
p.on('error', rej);
|
|
30
|
+
});
|
|
31
|
+
addFilesAsync(p, files).catch(er => p.emit('error', er));
|
|
32
|
+
return promise;
|
|
33
|
+
};
|
|
34
|
+
const addFilesSync = (p, files) => {
|
|
35
|
+
files.forEach(file => {
|
|
36
|
+
if (file.charAt(0) === '@') {
|
|
37
|
+
(0, list_js_1.list)({
|
|
38
|
+
file: node_path_1.default.resolve(p.cwd, file.slice(1)),
|
|
39
|
+
sync: true,
|
|
40
|
+
noResume: true,
|
|
41
|
+
onReadEntry: entry => p.add(entry),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
p.add(file);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
p.end();
|
|
49
|
+
};
|
|
50
|
+
const addFilesAsync = async (p, files) => {
|
|
51
|
+
for (const file of files) {
|
|
52
|
+
if (file.charAt(0) === '@') {
|
|
53
|
+
await (0, list_js_1.list)({
|
|
54
|
+
file: node_path_1.default.resolve(String(p.cwd), file.slice(1)),
|
|
55
|
+
noResume: true,
|
|
56
|
+
onReadEntry: entry => {
|
|
57
|
+
p.add(entry);
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
p.add(file);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
p.end();
|
|
66
|
+
};
|
|
67
|
+
const createSync = (opt, files) => {
|
|
68
|
+
const p = new pack_js_1.PackSync(opt);
|
|
69
|
+
addFilesSync(p, files);
|
|
70
|
+
return p;
|
|
71
|
+
};
|
|
72
|
+
const createAsync = (opt, files) => {
|
|
73
|
+
const p = new pack_js_1.Pack(opt);
|
|
74
|
+
addFilesAsync(p, files).catch(er => p.emit('error', er));
|
|
75
|
+
return p;
|
|
76
|
+
};
|
|
77
|
+
exports.create = (0, make_command_js_1.makeCommand)(createFileSync, createFile, createSync, createAsync, (_opt, files) => {
|
|
78
|
+
if (!files?.length) {
|
|
79
|
+
throw new TypeError('no paths specified to add to archive');
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=create.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.js","sourceRoot":"","sources":["../../src/create.ts"],"names":[],"mappings":";;;;;;AAAA,qDAAkE;AAElE,0DAA4B;AAC5B,uCAAgC;AAChC,uDAA+C;AAO/C,uCAA0C;AAE1C,MAAM,cAAc,GAAG,CAAC,GAAuB,EAAE,KAAe,EAAE,EAAE;IAClE,MAAM,CAAC,GAAG,IAAI,kBAAQ,CAAC,GAAG,CAAC,CAAA;IAC3B,MAAM,MAAM,GAAG,IAAI,6BAAe,CAAC,GAAG,CAAC,IAAI,EAAE;QAC3C,IAAI,EAAE,GAAG,CAAC,I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GAAG,IAAI,cAAI,CAAC,GAAG,CAAC,CAAA;IACvB,aAAa,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACxD,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAEY,QAAA,MAAM,GAAG,IAAA,6BAAW,EAC/B,cAAc,EACd,UAAU,EACV,UAAU,EACV,WAAW,EACX,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;IACd,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QACnB,MAAM,IAAI,SAAS,CAAC,sCAAsC,CAAC,CAAA;IAC7D,CAAC;AACH,CAAC,CACF,CAAA","sourcesContent":["import { WriteStream, WriteStreamSync } from '@isaacs/fs-minipass'\nimport type { Minipass } from 'minipass'\nimport path from 'node:path'\nimport { list } from './list.js'\nimport { makeCommand } from './make-command.js'\nimport type {\n TarOptions,\n TarOptionsFile,\n TarOptionsSync,\n TarOptionsSyncFile,\n} from './options.js'\nimport { Pack, PackSync } from './pack.js'\n\nconst createFileSync = (opt: TarOptionsSyncFile, files: string[]) => {\n const p = new PackSync(opt)\n const stream = new WriteStreamSync(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream as unknown as Minipass.Writable)\n addFilesSync(p, files)\n}\n\nconst createFile = (opt: TarOptionsFile, files: string[]) => {\n const p = new Pack(opt)\n const stream = new WriteStream(opt.file, {\n mode: opt.mode || 0o666,\n })\n p.pipe(stream as unknown as Minipass.Writable)\n\n const promise = new Promise<void>((res, rej) => {\n stream.on('error', rej)\n stream.on('close', res)\n p.on('error', rej)\n })\n\n addFilesAsync(p, files).catch(er => p.emit('error', er))\n\n return promise\n}\n\nconst addFilesSync = (p: PackSync, files: string[]) => {\n files.forEach(file => {\n if (file.charAt(0) === '@') {\n list({\n file: path.resolve(p.cwd, file.slice(1)),\n sync: true,\n noResume: true,\n onReadEntry: entry => p.add(entry),\n })\n } else {\n p.add(file)\n }\n })\n p.end()\n}\n\nconst addFilesAsync = async (p: Pack, files: string[]): Promise<void> => {\n for (const file of files) {\n if (file.charAt(0) === '@') {\n await list({\n file: path.resolve(String(p.cwd), file.slice(1)),\n noResume: true,\n onReadEntry: entry => {\n p.add(entry)\n },\n })\n } else {\n p.add(file)\n }\n }\n p.end()\n}\n\nconst createSync = (opt: TarOptionsSync, files: string[]) => {\n const p = new PackSync(opt)\n addFilesSync(p, files)\n return p\n}\n\nconst createAsync = (opt: TarOptions, files: string[]) => {\n const p = new Pack(opt)\n addFilesAsync(p, files).catch(er => p.emit('error', er))\n return p\n}\n\nexport const create = makeCommand(\n createFileSync,\n createFile,\n createSync,\n createAsync,\n (_opt, files) => {\n if (!files?.length) {\n throw new TypeError('no paths specified to add to archive')\n }\n },\n)\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cwd-error.d.ts","sourceRoot":"","sources":["../../src/cwd-error.ts"],"names":[],"mappings":"AAAA,qBAAa,QAAS,SAAQ,KAAK;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAG,OAAO,CAAS;gBAEd,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAMtC,IAAI,IAAI,WAEP;CACF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CwdError = void 0;
|
|
4
|
+
class CwdError extends Error {
|
|
5
|
+
path;
|
|
6
|
+
code;
|
|
7
|
+
syscall = 'chdir';
|
|
8
|
+
constructor(path, code) {
|
|
9
|
+
super(`${code}: Cannot cd into '${path}'`);
|
|
10
|
+
this.path = path;
|
|
11
|
+
this.code = code;
|
|
12
|
+
}
|
|
13
|
+
get name() {
|
|
14
|
+
return 'CwdError';
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.CwdError = CwdError;
|
|
18
|
+
//# sourceMappingURL=cwd-error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cwd-error.js","sourceRoot":"","sources":["../../src/cwd-error.ts"],"names":[],"mappings":";;;AAAA,MAAa,QAAS,SAAQ,KAAK;IACjC,IAAI,CAAQ;IACZ,IAAI,CAAQ;IACZ,OAAO,GAAG,OAAgB,CAAA;IAE1B,YAAY,IAAY,EAAE,IAAY;QACpC,KAAK,CAAC,GAAG,IAAI,qBAAqB,IAAI,GAAG,CAAC,CAAA;QAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAED,IAAI,IAAI;QACN,OAAO,UAAU,CAAA;IACnB,CAAC;CACF;AAdD,4BAcC","sourcesContent":["export class CwdError extends Error {\n path: string\n code: string\n syscall = 'chdir' as const\n\n constructor(path: string, code: string) {\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"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../src/extract.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AA2ChD,eAAO,MAAM,OAAO,4DAQnB,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.extract = void 0;
|
|
40
|
+
// tar -x
|
|
41
|
+
const fsm = __importStar(require("@isaacs/fs-minipass"));
|
|
42
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
43
|
+
const list_js_1 = require("./list.js");
|
|
44
|
+
const make_command_js_1 = require("./make-command.js");
|
|
45
|
+
const unpack_js_1 = require("./unpack.js");
|
|
46
|
+
const extractFileSync = (opt) => {
|
|
47
|
+
const u = new unpack_js_1.UnpackSync(opt);
|
|
48
|
+
const file = opt.file;
|
|
49
|
+
const stat = node_fs_1.default.statSync(file);
|
|
50
|
+
// This trades a zero-byte read() syscall for a stat
|
|
51
|
+
// However, it will usually result in less memory allocation
|
|
52
|
+
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
53
|
+
const stream = new fsm.ReadStreamSync(file, {
|
|
54
|
+
readSize: readSize,
|
|
55
|
+
size: stat.size,
|
|
56
|
+
});
|
|
57
|
+
stream.pipe(u);
|
|
58
|
+
};
|
|
59
|
+
const extractFile = (opt, _) => {
|
|
60
|
+
const u = new unpack_js_1.Unpack(opt);
|
|
61
|
+
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
62
|
+
const file = opt.file;
|
|
63
|
+
const p = new Promise((resolve, reject) => {
|
|
64
|
+
u.on('error', reject);
|
|
65
|
+
u.on('close', resolve);
|
|
66
|
+
// This trades a zero-byte read() syscall for a stat
|
|
67
|
+
// However, it will usually result in less memory allocation
|
|
68
|
+
node_fs_1.default.stat(file, (er, stat) => {
|
|
69
|
+
if (er) {
|
|
70
|
+
reject(er);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
const stream = new fsm.ReadStream(file, {
|
|
74
|
+
readSize: readSize,
|
|
75
|
+
size: stat.size,
|
|
76
|
+
});
|
|
77
|
+
stream.on('error', reject);
|
|
78
|
+
stream.pipe(u);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
return p;
|
|
83
|
+
};
|
|
84
|
+
exports.extract = (0, make_command_js_1.makeCommand)(extractFileSync, extractFile, opt => new unpack_js_1.UnpackSync(opt), opt => new unpack_js_1.Unpack(opt), (opt, files) => {
|
|
85
|
+
if (files?.length)
|
|
86
|
+
(0, list_js_1.filesFilter)(opt, files);
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=extract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract.js","sourceRoot":"","sources":["../../src/extract.ts"],"names":[],"mappings":";;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EAAE,IAAI,EAAE,EAAE;YACzB,IAAI,EAAE,EAAE,CAAC;gBACP,MAAM,CAAC,EAAE,CAAC,CAAA;YACZ,CAAC;iBAAM,CAAC;gBACN,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE;oBACtC,QAAQ,EAAE,QAAQ;oBAClB,IAAI,EAAE,IAAI,CAAC,IAAI;iBAChB,CAAC,CAAA;gBACF,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;gBAC1B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;YAChB,CAAC;QACH,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,OAAO,CAAC,CAAA;AACV,CAAC,CAAA;AAEY,QAAA,OAAO,GAAG,IAAA,6BAAW,EAChC,eAAe,EACf,WAAW,EACX,GAAG,CAAC,EAAE,CAAC,IAAI,sBAAU,CAAC,GAAG,CAAC,EAC1B,GAAG,CAAC,EAAE,CAAC,IAAI,kBAAM,CAAC,GAAG,CAAC,EACtB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;IACb,IAAI,KAAK,EAAE,MAAM;QAAE,IAAA,qBAAW,EAAC,GAAG,EAAE,KAAK,CAAC,CAAA;AAC5C,CAAC,CACF,CAAA","sourcesContent":["// tar -x\nimport * as fsm from '@isaacs/fs-minipass'\nimport fs from 'node:fs'\nimport { filesFilter } from './list.js'\nimport { makeCommand } from './make-command.js'\nimport type { TarOptionsFile, TarOptionsSyncFile } from './options.js'\nimport { Unpack, UnpackSync } from './unpack.js'\n\nconst extractFileSync = (opt: TarOptionsSyncFile) => {\n const u = new UnpackSync(opt)\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: TarOptionsFile, _?: string[]) => {\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<void>((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 p\n}\n\nexport const extract = makeCommand<Unpack, UnpackSync>(\n extractFileSync,\n extractFile,\n opt => new UnpackSync(opt),\n opt => new Unpack(opt),\n (opt, files) => {\n if (files?.length) filesFilter(opt, files)\n },\n)\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-write-flag.d.ts","sourceRoot":"","sources":["../../src/get-write-flag.ts"],"names":[],"mappings":"AA4BA,eAAO,MAAM,YAAY,2BAGd,MAAM,kBAAwC,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Get the appropriate flag to use for creating files
|
|
3
|
+
// We use fmap on Windows platforms for files less than
|
|
4
|
+
// 512kb. This is a fairly low limit, but avoids making
|
|
5
|
+
// things slower in some cases. Since most of what this
|
|
6
|
+
// library is used for is extracting tarballs of many
|
|
7
|
+
// relatively small files in npm packages and the like,
|
|
8
|
+
// it can be a big boost on Windows platforms.
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.getWriteFlag = void 0;
|
|
14
|
+
const fs_1 = __importDefault(require("fs"));
|
|
15
|
+
const platform = process.env.__FAKE_PLATFORM__ || process.platform;
|
|
16
|
+
const isWindows = platform === 'win32';
|
|
17
|
+
/* c8 ignore start */
|
|
18
|
+
const { O_CREAT, O_NOFOLLOW, O_TRUNC, O_WRONLY } = fs_1.default.constants;
|
|
19
|
+
const UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) ||
|
|
20
|
+
fs_1.default.constants.UV_FS_O_FILEMAP ||
|
|
21
|
+
0;
|
|
22
|
+
/* c8 ignore stop */
|
|
23
|
+
const fMapEnabled = isWindows && !!UV_FS_O_FILEMAP;
|
|
24
|
+
const fMapLimit = 512 * 1024;
|
|
25
|
+
const fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY;
|
|
26
|
+
const noFollowFlag = !isWindows && typeof O_NOFOLLOW === 'number' ?
|
|
27
|
+
O_NOFOLLOW | O_TRUNC | O_CREAT | O_WRONLY
|
|
28
|
+
: null;
|
|
29
|
+
exports.getWriteFlag = noFollowFlag !== null ? () => noFollowFlag
|
|
30
|
+
: !fMapEnabled ? () => 'w'
|
|
31
|
+
: (size) => (size < fMapLimit ? fMapFlag : 'w');
|
|
32
|
+
//# sourceMappingURL=get-write-flag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-write-flag.js","sourceRoot":"","sources":["../../src/get-write-flag.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,uDAAuD;AACvD,wDAAwD;AACxD,wDAAwD;AACxD,qDAAqD;AACrD,uDAAuD;AACvD,8CAA8C;;;;;;AAE9C,4CAAmB;AAEnB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,QAAQ,CAAA;AAClE,MAAM,SAAS,GAAG,QAAQ,KAAK,OAAO,CAAA;AAEtC,qBAAqB;AACrB,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,YAAE,CAAC,SAAS,CAAA;AAC/D,MAAM,eAAe,GACnB,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;IAC1C,YAAE,CAAC,SAAS,CAAC,eAAe;IAC5B,CAAC,CAAA;AACH,oBAAoB;AAEpB,MAAM,WAAW,GAAG,SAAS,IAAI,CAAC,CAAC,eAAe,CAAA;AAClD,MAAM,SAAS,GAAG,GAAG,GAAG,IAAI,CAAA;AAC5B,MAAM,QAAQ,GAAG,eAAe,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAA;AAC/D,MAAM,YAAY,GAChB,CAAC,SAAS,IAAI,OAAO,UAAU,KAAK,QAAQ,CAAC,CAAC;IAC5C,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ;IAC3C,CAAC,CAAC,IAAI,CAAA;AACK,QAAA,YAAY,GACvB,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,YAAY;IAC1C,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG;QAC1B,CAAC,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA","sourcesContent":["// 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\nimport fs from 'fs'\n\nconst platform = process.env.__FAKE_PLATFORM__ || process.platform\nconst isWindows = platform === 'win32'\n\n/* c8 ignore start */\nconst { O_CREAT, O_NOFOLLOW, O_TRUNC, O_WRONLY } = fs.constants\nconst UV_FS_O_FILEMAP =\n Number(process.env.__FAKE_FS_O_FILENAME__) ||\n fs.constants.UV_FS_O_FILEMAP ||\n 0\n/* c8 ignore stop */\n\nconst fMapEnabled = isWindows && !!UV_FS_O_FILEMAP\nconst fMapLimit = 512 * 1024\nconst fMapFlag = UV_FS_O_FILEMAP | O_TRUNC | O_CREAT | O_WRONLY\nconst noFollowFlag =\n !isWindows && typeof O_NOFOLLOW === 'number' ?\n O_NOFOLLOW | O_TRUNC | O_CREAT | O_WRONLY\n : null\nexport const getWriteFlag =\n noFollowFlag !== null ? () => noFollowFlag\n : !fMapEnabled ? () => 'w'\n : (size: number) => (size < fMapLimit ? fMapFlag : 'w')\n"]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { EntryTypeCode, EntryTypeName } from './types.js';
|
|
2
|
+
export type HeaderData = {
|
|
3
|
+
path?: string;
|
|
4
|
+
mode?: number;
|
|
5
|
+
uid?: number;
|
|
6
|
+
gid?: number;
|
|
7
|
+
size?: number;
|
|
8
|
+
cksum?: number;
|
|
9
|
+
type?: EntryTypeName | 'Unsupported';
|
|
10
|
+
linkpath?: string;
|
|
11
|
+
uname?: string;
|
|
12
|
+
gname?: string;
|
|
13
|
+
devmaj?: number;
|
|
14
|
+
devmin?: number;
|
|
15
|
+
atime?: Date;
|
|
16
|
+
ctime?: Date;
|
|
17
|
+
mtime?: Date;
|
|
18
|
+
charset?: string;
|
|
19
|
+
comment?: string;
|
|
20
|
+
dev?: number;
|
|
21
|
+
ino?: number;
|
|
22
|
+
nlink?: number;
|
|
23
|
+
};
|
|
24
|
+
export declare class Header implements HeaderData {
|
|
25
|
+
#private;
|
|
26
|
+
cksumValid: boolean;
|
|
27
|
+
needPax: boolean;
|
|
28
|
+
nullBlock: boolean;
|
|
29
|
+
block?: Buffer;
|
|
30
|
+
path?: string;
|
|
31
|
+
mode?: number;
|
|
32
|
+
uid?: number;
|
|
33
|
+
gid?: number;
|
|
34
|
+
size?: number;
|
|
35
|
+
cksum?: number;
|
|
36
|
+
linkpath?: string;
|
|
37
|
+
uname?: string;
|
|
38
|
+
gname?: string;
|
|
39
|
+
devmaj: number;
|
|
40
|
+
devmin: number;
|
|
41
|
+
atime?: Date;
|
|
42
|
+
ctime?: Date;
|
|
43
|
+
mtime?: Date;
|
|
44
|
+
charset?: string;
|
|
45
|
+
comment?: string;
|
|
46
|
+
constructor(data?: Buffer | HeaderData, off?: number, ex?: HeaderData, gex?: HeaderData);
|
|
47
|
+
decode(buf: Buffer, off: number, ex?: HeaderData, gex?: HeaderData): void;
|
|
48
|
+
encode(buf?: Buffer, off?: number): boolean;
|
|
49
|
+
get type(): EntryTypeName;
|
|
50
|
+
get typeKey(): EntryTypeCode | 'Unsupported';
|
|
51
|
+
set type(type: EntryTypeCode | EntryTypeName | 'Unsupported');
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../src/header.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG9D,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,aAAa,GAAG,aAAa,CAAA;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,KAAK,CAAC,EAAE,IAAI,CAAA;IACZ,KAAK,CAAC,EAAE,IAAI,CAAA;IAIZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK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3D;CACF"}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// parse a 512-byte header block to a data object, or vice-versa
|
|
3
|
+
// encode returns `true` if a pax extended header is needed, because
|
|
4
|
+
// the data could not be faithfully encoded in a simple header.
|
|
5
|
+
// (Also, check header.needPax to see if it needs a pax header.)
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.Header = void 0;
|
|
41
|
+
const node_path_1 = require("node:path");
|
|
42
|
+
const large = __importStar(require("./large-numbers.js"));
|
|
43
|
+
const types = __importStar(require("./types.js"));
|
|
44
|
+
class Header {
|
|
45
|
+
cksumValid = false;
|
|
46
|
+
needPax = false;
|
|
47
|
+
nullBlock = false;
|
|
48
|
+
block;
|
|
49
|
+
path;
|
|
50
|
+
mode;
|
|
51
|
+
uid;
|
|
52
|
+
gid;
|
|
53
|
+
size;
|
|
54
|
+
cksum;
|
|
55
|
+
#type = 'Unsupported';
|
|
56
|
+
linkpath;
|
|
57
|
+
uname;
|
|
58
|
+
gname;
|
|
59
|
+
devmaj = 0;
|
|
60
|
+
devmin = 0;
|
|
61
|
+
atime;
|
|
62
|
+
ctime;
|
|
63
|
+
mtime;
|
|
64
|
+
charset;
|
|
65
|
+
comment;
|
|
66
|
+
constructor(data, off = 0, ex, gex) {
|
|
67
|
+
if (Buffer.isBuffer(data)) {
|
|
68
|
+
this.decode(data, off || 0, ex, gex);
|
|
69
|
+
}
|
|
70
|
+
else if (data) {
|
|
71
|
+
this.#slurp(data);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
decode(buf, off, ex, gex) {
|
|
75
|
+
if (!off) {
|
|
76
|
+
off = 0;
|
|
77
|
+
}
|
|
78
|
+
if (!buf || !(buf.length >= off + 512)) {
|
|
79
|
+
throw new Error('need 512 bytes for header');
|
|
80
|
+
}
|
|
81
|
+
this.path = ex?.path ?? decString(buf, off, 100);
|
|
82
|
+
this.mode = ex?.mode ?? gex?.mode ?? decNumber(buf, off + 100, 8);
|
|
83
|
+
this.uid = ex?.uid ?? gex?.uid ?? decNumber(buf, off + 108, 8);
|
|
84
|
+
this.gid = ex?.gid ?? gex?.gid ?? decNumber(buf, off + 116, 8);
|
|
85
|
+
this.size = ex?.size ?? gex?.size ?? decNumber(buf, off + 124, 12);
|
|
86
|
+
this.mtime = ex?.mtime ?? gex?.mtime ?? decDate(buf, off + 136, 12);
|
|
87
|
+
this.cksum = decNumber(buf, off + 148, 12);
|
|
88
|
+
// if we have extended or global extended headers, apply them now
|
|
89
|
+
// See https://github.com/npm/node-tar/pull/187
|
|
90
|
+
// Apply global before local, so it overrides
|
|
91
|
+
if (gex)
|
|
92
|
+
this.#slurp(gex, true);
|
|
93
|
+
if (ex)
|
|
94
|
+
this.#slurp(ex);
|
|
95
|
+
// old tar versions marked dirs as a file with a trailing /
|
|
96
|
+
const t = decString(buf, off + 156, 1);
|
|
97
|
+
if (types.isCode(t)) {
|
|
98
|
+
this.#type = t || '0';
|
|
99
|
+
}
|
|
100
|
+
if (this.#type === '0' && this.path.slice(-1) === '/') {
|
|
101
|
+
this.#type = '5';
|
|
102
|
+
}
|
|
103
|
+
// tar implementations sometimes incorrectly put the stat(dir).size
|
|
104
|
+
// as the size in the tarball, even though Directory entries are
|
|
105
|
+
// not able to have any body at all. In the very rare chance that
|
|
106
|
+
// it actually DOES have a body, we weren't going to do anything with
|
|
107
|
+
// it anyway, and it'll just be a warning about an invalid header.
|
|
108
|
+
if (this.#type === '5') {
|
|
109
|
+
this.size = 0;
|
|
110
|
+
}
|
|
111
|
+
this.linkpath = decString(buf, off + 157, 100);
|
|
112
|
+
if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') {
|
|
113
|
+
/* c8 ignore start */
|
|
114
|
+
this.uname = ex?.uname ?? gex?.uname ?? decString(buf, off + 265, 32);
|
|
115
|
+
this.gname = ex?.gname ?? gex?.gname ?? decString(buf, off + 297, 32);
|
|
116
|
+
this.devmaj =
|
|
117
|
+
ex?.devmaj ?? gex?.devmaj ?? decNumber(buf, off + 329, 8) ?? 0;
|
|
118
|
+
this.devmin =
|
|
119
|
+
ex?.devmin ?? gex?.devmin ?? decNumber(buf, off + 337, 8) ?? 0;
|
|
120
|
+
/* c8 ignore stop */
|
|
121
|
+
if (buf[off + 475] !== 0) {
|
|
122
|
+
// definitely a prefix, definitely >130 chars.
|
|
123
|
+
const prefix = decString(buf, off + 345, 155);
|
|
124
|
+
this.path = prefix + '/' + this.path;
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
const prefix = decString(buf, off + 345, 130);
|
|
128
|
+
if (prefix) {
|
|
129
|
+
this.path = prefix + '/' + this.path;
|
|
130
|
+
}
|
|
131
|
+
/* c8 ignore start */
|
|
132
|
+
this.atime = ex?.atime ?? gex?.atime ?? decDate(buf, off + 476, 12);
|
|
133
|
+
this.ctime = ex?.ctime ?? gex?.ctime ?? decDate(buf, off + 488, 12);
|
|
134
|
+
/* c8 ignore stop */
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
let sum = 8 * 0x20;
|
|
138
|
+
for (let i = off; i < off + 148; i++) {
|
|
139
|
+
sum += buf[i];
|
|
140
|
+
}
|
|
141
|
+
for (let i = off + 156; i < off + 512; i++) {
|
|
142
|
+
sum += buf[i];
|
|
143
|
+
}
|
|
144
|
+
this.cksumValid = sum === this.cksum;
|
|
145
|
+
if (this.cksum === undefined && sum === 8 * 0x20) {
|
|
146
|
+
this.nullBlock = true;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
#slurp(ex, gex = false) {
|
|
150
|
+
Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
|
|
151
|
+
// we slurp in everything except for the path attribute in
|
|
152
|
+
// a global extended header, because that's weird. Also, any
|
|
153
|
+
// null/undefined values are ignored.
|
|
154
|
+
return !(v === null ||
|
|
155
|
+
v === undefined ||
|
|
156
|
+
(k === 'path' && gex) ||
|
|
157
|
+
(k === 'linkpath' && gex) ||
|
|
158
|
+
k === 'global');
|
|
159
|
+
})));
|
|
160
|
+
}
|
|
161
|
+
encode(buf, off = 0) {
|
|
162
|
+
if (!buf) {
|
|
163
|
+
buf = this.block = Buffer.alloc(512);
|
|
164
|
+
}
|
|
165
|
+
if (this.#type === 'Unsupported') {
|
|
166
|
+
this.#type = '0';
|
|
167
|
+
}
|
|
168
|
+
if (!(buf.length >= off + 512)) {
|
|
169
|
+
throw new Error('need 512 bytes for header');
|
|
170
|
+
}
|
|
171
|
+
const prefixSize = this.ctime || this.atime ? 130 : 155;
|
|
172
|
+
const split = splitPrefix(this.path || '', prefixSize);
|
|
173
|
+
const path = split[0];
|
|
174
|
+
const prefix = split[1];
|
|
175
|
+
this.needPax = !!split[2];
|
|
176
|
+
this.needPax = encString(buf, off, 100, path) || this.needPax;
|
|
177
|
+
this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax;
|
|
178
|
+
this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax;
|
|
179
|
+
this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax;
|
|
180
|
+
this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax;
|
|
181
|
+
this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax;
|
|
182
|
+
buf[off + 156] = Number(this.#type.codePointAt(0));
|
|
183
|
+
this.needPax =
|
|
184
|
+
encString(buf, off + 157, 100, this.linkpath) || this.needPax;
|
|
185
|
+
buf.write('ustar\u000000', off + 257, 8);
|
|
186
|
+
this.needPax =
|
|
187
|
+
encString(buf, off + 265, 32, this.uname) || this.needPax;
|
|
188
|
+
this.needPax =
|
|
189
|
+
encString(buf, off + 297, 32, this.gname) || this.needPax;
|
|
190
|
+
this.needPax =
|
|
191
|
+
encNumber(buf, off + 329, 8, this.devmaj) || this.needPax;
|
|
192
|
+
this.needPax =
|
|
193
|
+
encNumber(buf, off + 337, 8, this.devmin) || this.needPax;
|
|
194
|
+
this.needPax =
|
|
195
|
+
encString(buf, off + 345, prefixSize, prefix) || this.needPax;
|
|
196
|
+
if (buf[off + 475] !== 0) {
|
|
197
|
+
this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax;
|
|
201
|
+
this.needPax =
|
|
202
|
+
encDate(buf, off + 476, 12, this.atime) || this.needPax;
|
|
203
|
+
this.needPax =
|
|
204
|
+
encDate(buf, off + 488, 12, this.ctime) || this.needPax;
|
|
205
|
+
}
|
|
206
|
+
let sum = 8 * 0x20;
|
|
207
|
+
for (let i = off; i < off + 148; i++) {
|
|
208
|
+
sum += buf[i];
|
|
209
|
+
}
|
|
210
|
+
for (let i = off + 156; i < off + 512; i++) {
|
|
211
|
+
sum += buf[i];
|
|
212
|
+
}
|
|
213
|
+
this.cksum = sum;
|
|
214
|
+
encNumber(buf, off + 148, 8, this.cksum);
|
|
215
|
+
this.cksumValid = true;
|
|
216
|
+
return this.needPax;
|
|
217
|
+
}
|
|
218
|
+
get type() {
|
|
219
|
+
return (this.#type === 'Unsupported' ?
|
|
220
|
+
this.#type
|
|
221
|
+
: types.name.get(this.#type));
|
|
222
|
+
}
|
|
223
|
+
get typeKey() {
|
|
224
|
+
return this.#type;
|
|
225
|
+
}
|
|
226
|
+
set type(type) {
|
|
227
|
+
const c = String(types.code.get(type));
|
|
228
|
+
if (types.isCode(c) || c === 'Unsupported') {
|
|
229
|
+
this.#type = c;
|
|
230
|
+
}
|
|
231
|
+
else if (types.isCode(type)) {
|
|
232
|
+
this.#type = type;
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
throw new TypeError('invalid entry type: ' + type);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
exports.Header = Header;
|
|
240
|
+
const splitPrefix = (p, prefixSize) => {
|
|
241
|
+
const pathSize = 100;
|
|
242
|
+
let pp = p;
|
|
243
|
+
let prefix = '';
|
|
244
|
+
let ret = undefined;
|
|
245
|
+
const root = node_path_1.posix.parse(p).root || '.';
|
|
246
|
+
if (Buffer.byteLength(pp) < pathSize) {
|
|
247
|
+
ret = [pp, prefix, false];
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
// first set prefix to the dir, and path to the base
|
|
251
|
+
prefix = node_path_1.posix.dirname(pp);
|
|
252
|
+
pp = node_path_1.posix.basename(pp);
|
|
253
|
+
do {
|
|
254
|
+
if (Buffer.byteLength(pp) <= pathSize &&
|
|
255
|
+
Buffer.byteLength(prefix) <= prefixSize) {
|
|
256
|
+
// both fit!
|
|
257
|
+
ret = [pp, prefix, false];
|
|
258
|
+
}
|
|
259
|
+
else if (Buffer.byteLength(pp) > pathSize &&
|
|
260
|
+
Buffer.byteLength(prefix) <= prefixSize) {
|
|
261
|
+
// prefix fits in prefix, but path doesn't fit in path
|
|
262
|
+
ret = [pp.slice(0, pathSize - 1), prefix, true];
|
|
263
|
+
}
|
|
264
|
+
else {
|
|
265
|
+
// make path take a bit from prefix
|
|
266
|
+
pp = node_path_1.posix.join(node_path_1.posix.basename(prefix), pp);
|
|
267
|
+
prefix = node_path_1.posix.dirname(prefix);
|
|
268
|
+
}
|
|
269
|
+
} while (prefix !== root && ret === undefined);
|
|
270
|
+
// at this point, found no resolution, just truncate
|
|
271
|
+
if (!ret) {
|
|
272
|
+
ret = [p.slice(0, pathSize - 1), '', true];
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return ret;
|
|
276
|
+
};
|
|
277
|
+
const decString = (buf, off, size) => buf
|
|
278
|
+
.subarray(off, off + size)
|
|
279
|
+
.toString('utf8')
|
|
280
|
+
.replace(/\0.*/, '');
|
|
281
|
+
const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size));
|
|
282
|
+
const numToDate = (num) => num === undefined ? undefined : new Date(num * 1000);
|
|
283
|
+
const decNumber = (buf, off, size) => Number(buf[off]) & 0x80 ?
|
|
284
|
+
large.parse(buf.subarray(off, off + size))
|
|
285
|
+
: decSmallNumber(buf, off, size);
|
|
286
|
+
const nanUndef = (value) => (isNaN(value) ? undefined : value);
|
|
287
|
+
const decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf
|
|
288
|
+
.subarray(off, off + size)
|
|
289
|
+
.toString('utf8')
|
|
290
|
+
.replace(/\0.*$/, '')
|
|
291
|
+
.trim(), 8));
|
|
292
|
+
// the maximum encodable as a null-terminated octal, by field size
|
|
293
|
+
const MAXNUM = {
|
|
294
|
+
12: 0o77777777777,
|
|
295
|
+
8: 0o7777777,
|
|
296
|
+
};
|
|
297
|
+
const encNumber = (buf, off, size, num) => num === undefined ? false
|
|
298
|
+
: num > MAXNUM[size] || num < 0 ?
|
|
299
|
+
(large.encode(num, buf.subarray(off, off + size)), true)
|
|
300
|
+
: (encSmallNumber(buf, off, size, num), false);
|
|
301
|
+
const encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, 'ascii');
|
|
302
|
+
const octalString = (num, size) => padOctal(Math.floor(num).toString(8), size);
|
|
303
|
+
const padOctal = (str, size) => (str.length === size - 1 ?
|
|
304
|
+
str
|
|
305
|
+
: new Array(size - str.length - 1).join('0') + str + ' ') + '\0';
|
|
306
|
+
const encDate = (buf, off, size, date) => date === undefined ? false : (encNumber(buf, off, size, date.getTime() / 1000));
|
|
307
|
+
// enough to fill the longest string we've got
|
|
308
|
+
const NULLS = new Array(156).join('\0');
|
|
309
|
+
// pad with nulls, return true if it's longer or non-ascii
|
|
310
|
+
const encString = (buf, off, size, str) => str === undefined ? false : ((buf.write(str + NULLS, off, size, 'utf8'),
|
|
311
|
+
str.length !== Buffer.byteLength(str) || str.length > size));
|
|
312
|
+
//# sourceMappingURL=header.js.map
|