update
This commit is contained in:
@@ -0,0 +1 @@
|
||||
module.exports={A:{D:{"1":"0 9 uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC","2":"1 2 3 4 5 6 7 8 J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB"},L:{"1":"I"},B:{"1":"0 9 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC","2":"nC LC J PB qC rC"},M:{"1":"EC"},A:{"2":"K D E F A B mC"},F:{"1":"0 hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z","2":"1 2 3 4 5 6 7 8 F B C G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB 4C 5C 6C 7C FC kC 8C GC"},K:{"1":"H","2":"A B C FC kC GC"},E:{"2":"J PB K D sC SC tC uC vC 3C","33":"E F A B C L M G wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC"},G:{"2":"SC 9C lC AD BD CD","33":"E DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},P:{"1":"1 2 3 4 5 6 7 8 fD gD hD TC iD jD kD lD mD IC JC KC nD","2":"J dD eD"},I:{"1":"I","2":"LC J XD YD ZD aD lC bD cD"}},B:6,C:"text-decoration shorthand property",D:undefined};
|
||||
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "lodash.merge",
|
||||
"version": "4.6.2",
|
||||
"description": "The Lodash method `_.merge` exported as a module.",
|
||||
"homepage": "https://lodash.com/",
|
||||
"icon": "https://lodash.com/icon.svg",
|
||||
"license": "MIT",
|
||||
"keywords": "lodash-modularized, merge",
|
||||
"author": "John-David Dalton <john.david.dalton@gmail.com>",
|
||||
"contributors": [
|
||||
"John-David Dalton <john.david.dalton@gmail.com>",
|
||||
"Mathias Bynens <mathias@qiwi.be>"
|
||||
],
|
||||
"repository": "lodash/lodash",
|
||||
"scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./cjs/scheduler.native.production.js');
|
||||
} else {
|
||||
module.exports = require('./cjs/scheduler.native.development.js');
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"names":["ReferencedIdentifier","exports","ReferencedMemberExpression","BindingIdentifier","Statement","Expression","Scope","Referenced","BlockScoped","Var","User","Generated","Pure","Flow","RestProperty","SpreadProperty","ExistentialTypeParam","NumericLiteralTypeAnnotation","ForAwaitStatement"],"sources":["../../../src/path/lib/virtual-types.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\n\nexport interface VirtualTypeAliases {\n BindingIdentifier: t.Identifier;\n BlockScoped: t.Node;\n ExistentialTypeParam: t.ExistsTypeAnnotation;\n Expression: t.Expression;\n Flow: t.Flow | t.ImportDeclaration | t.ExportDeclaration | t.ImportSpecifier;\n ForAwaitStatement: t.ForOfStatement;\n Generated: t.Node;\n NumericLiteralTypeAnnotation: t.NumberLiteralTypeAnnotation;\n Pure: t.Node;\n Referenced: t.Node;\n ReferencedIdentifier: t.Identifier | t.JSXIdentifier;\n ReferencedMemberExpression: t.MemberExpression;\n RestProperty: t.RestElement;\n Scope: t.Scopable | t.Pattern;\n SpreadProperty: t.RestElement;\n Statement: t.Statement;\n User: t.Node;\n Var: t.VariableDeclaration;\n}\n\ntype VirtualTypeMapping = readonly (t.Node[\"type\"] | keyof t.Aliases)[] | null;\n\nexport const ReferencedIdentifier: VirtualTypeMapping = [\n \"Identifier\",\n \"JSXIdentifier\",\n] as const;\n\nexport const ReferencedMemberExpression: VirtualTypeMapping = [\n \"MemberExpression\",\n] as const;\n\nexport const BindingIdentifier: VirtualTypeMapping = [\"Identifier\"] as const;\n\nexport const Statement: VirtualTypeMapping = [\"Statement\"] as const;\n\nexport const Expression: VirtualTypeMapping = [\"Expression\"] as const;\n\nexport const Scope: VirtualTypeMapping = [\"Scopable\", \"Pattern\"] as const;\n\nexport const Referenced: VirtualTypeMapping = null;\n\nexport const BlockScoped: VirtualTypeMapping = null;\n\nexport const Var: VirtualTypeMapping = [\"VariableDeclaration\"];\n\nexport const User: VirtualTypeMapping = null;\n\nexport const Generated: VirtualTypeMapping = null;\n\nexport const Pure: VirtualTypeMapping = null;\n\nexport const Flow: VirtualTypeMapping = [\n \"Flow\",\n \"ImportDeclaration\",\n \"ExportDeclaration\",\n \"ImportSpecifier\",\n] as const;\n\n// TODO: 7.0 Backwards Compat\nexport const RestProperty: VirtualTypeMapping = [\"RestElement\"] as const;\n\nexport const SpreadProperty: VirtualTypeMapping = [\"RestElement\"] as const;\n\nexport const ExistentialTypeParam: VirtualTypeMapping = [\n \"ExistsTypeAnnotation\",\n] as const;\n\nexport const NumericLiteralTypeAnnotation: VirtualTypeMapping = [\n \"NumberLiteralTypeAnnotation\",\n] as const;\n\nexport const ForAwaitStatement: VirtualTypeMapping = [\n \"ForOfStatement\",\n] as const;\n"],"mappings":";;;;;;AAyBO,MAAMA,oBAAwC,GAAAC,OAAA,CAAAD,oBAAA,GAAG,CACtD,YAAY,EACZ,eAAe,CACP;AAEH,MAAME,0BAA8C,GAAAD,OAAA,CAAAC,0BAAA,GAAG,CAC5D,kBAAkB,CACV;AAEH,MAAMC,iBAAqC,GAAAF,OAAA,CAAAE,iBAAA,GAAG,CAAC,YAAY,CAAU;AAErE,MAAMC,SAA6B,GAAAH,OAAA,CAAAG,SAAA,GAAG,CAAC,WAAW,CAAU;AAE5D,MAAMC,UAA8B,GAAAJ,OAAA,CAAAI,UAAA,GAAG,CAAC,YAAY,CAAU;AAE9D,MAAMC,KAAyB,GAAAL,OAAA,CAAAK,KAAA,GAAG,CAAC,UAAU,EAAE,SAAS,CAAU;AAElE,MAAMC,UAA8B,GAAAN,OAAA,CAAAM,UAAA,GAAG,IAAI;AAE3C,MAAMC,WAA+B,GAAAP,OAAA,CAAAO,WAAA,GAAG,IAAI;AAE5C,MAAMC,GAAuB,GAAAR,OAAA,CAAAQ,GAAA,GAAG,CAAC,qBAAqB,CAAC;AAEvD,MAAMC,IAAwB,GAAAT,OAAA,CAAAS,IAAA,GAAG,IAAI;AAErC,MAAMC,SAA6B,GAAAV,OAAA,CAAAU,SAAA,GAAG,IAAI;AAE1C,MAAMC,IAAwB,GAAAX,OAAA,CAAAW,IAAA,GAAG,IAAI;AAErC,MAAMC,IAAwB,GAAAZ,OAAA,CAAAY,IAAA,GAAG,CACtC,MAAM,EACN,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,CACT;AAGH,MAAMC,YAAgC,GAAAb,OAAA,CAAAa,YAAA,GAAG,CAAC,aAAa,CAAU;AAEjE,MAAMC,cAAkC,GAAAd,OAAA,CAAAc,cAAA,GAAG,CAAC,aAAa,CAAU;AAEnE,MAAMC,oBAAwC,GAAAf,OAAA,CAAAe,oBAAA,GAAG,CACtD,sBAAsB,CACd;AAEH,MAAMC,4BAAgD,GAAAhB,OAAA,CAAAgB,4BAAA,GAAG,CAC9D,6BAA6B,CACrB;AAEH,MAAMC,iBAAqC,GAAAjB,OAAA,CAAAiB,iBAAA,GAAG,CACnD,gBAAgB,CACR","ignoreList":[]}
|
||||
@@ -0,0 +1,15 @@
|
||||
// parse out just the options we care about
|
||||
const looseOption = Object.freeze({ loose: true })
|
||||
const emptyOpts = Object.freeze({ })
|
||||
const parseOptions = options => {
|
||||
if (!options) {
|
||||
return emptyOpts
|
||||
}
|
||||
|
||||
if (typeof options !== 'object') {
|
||||
return looseOption
|
||||
}
|
||||
|
||||
return options
|
||||
}
|
||||
module.exports = parseOptions
|
||||
@@ -0,0 +1,869 @@
|
||||
'use strict'
|
||||
|
||||
const tape = require('tape')
|
||||
const crypto = require('crypto')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const BufferList = require('../')
|
||||
const { Buffer } = require('buffer')
|
||||
|
||||
const encodings =
|
||||
('hex utf8 utf-8 ascii binary base64' +
|
||||
(process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
|
||||
|
||||
require('./indexOf')
|
||||
require('./isBufferList')
|
||||
require('./convert')
|
||||
|
||||
tape('single bytes from single buffer', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('abcd'))
|
||||
|
||||
t.equal(bl.length, 4)
|
||||
t.equal(bl.get(-1), undefined)
|
||||
t.equal(bl.get(0), 97)
|
||||
t.equal(bl.get(1), 98)
|
||||
t.equal(bl.get(2), 99)
|
||||
t.equal(bl.get(3), 100)
|
||||
t.equal(bl.get(4), undefined)
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('single bytes from multiple buffers', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('abcd'))
|
||||
bl.append(Buffer.from('efg'))
|
||||
bl.append(Buffer.from('hi'))
|
||||
bl.append(Buffer.from('j'))
|
||||
|
||||
t.equal(bl.length, 10)
|
||||
|
||||
t.equal(bl.get(0), 97)
|
||||
t.equal(bl.get(1), 98)
|
||||
t.equal(bl.get(2), 99)
|
||||
t.equal(bl.get(3), 100)
|
||||
t.equal(bl.get(4), 101)
|
||||
t.equal(bl.get(5), 102)
|
||||
t.equal(bl.get(6), 103)
|
||||
t.equal(bl.get(7), 104)
|
||||
t.equal(bl.get(8), 105)
|
||||
t.equal(bl.get(9), 106)
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('multi bytes from single buffer', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('abcd'))
|
||||
|
||||
t.equal(bl.length, 4)
|
||||
|
||||
t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
|
||||
t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
|
||||
t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
|
||||
t.equal(bl.slice(-4, -1).toString('ascii'), 'abc')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('multi bytes from single buffer (negative indexes)', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('buffer'))
|
||||
|
||||
t.equal(bl.length, 6)
|
||||
|
||||
t.equal(bl.slice(-6, -1).toString('ascii'), 'buffe')
|
||||
t.equal(bl.slice(-6, -2).toString('ascii'), 'buff')
|
||||
t.equal(bl.slice(-5, -2).toString('ascii'), 'uff')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('multiple bytes from multiple buffers', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('abcd'))
|
||||
bl.append(Buffer.from('efg'))
|
||||
bl.append(Buffer.from('hi'))
|
||||
bl.append(Buffer.from('j'))
|
||||
|
||||
t.equal(bl.length, 10)
|
||||
|
||||
t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
|
||||
t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
|
||||
t.equal(bl.slice(3, 6).toString('ascii'), 'def')
|
||||
t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
|
||||
t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
|
||||
t.equal(bl.slice(-7, -4).toString('ascii'), 'def')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('multiple bytes from multiple buffer lists', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(new BufferList([Buffer.from('abcd'), Buffer.from('efg')]))
|
||||
bl.append(new BufferList([Buffer.from('hi'), Buffer.from('j')]))
|
||||
|
||||
t.equal(bl.length, 10)
|
||||
|
||||
t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
|
||||
|
||||
t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
|
||||
t.equal(bl.slice(3, 6).toString('ascii'), 'def')
|
||||
t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
|
||||
t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
// same data as previous test, just using nested constructors
|
||||
tape('multiple bytes from crazy nested buffer lists', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(new BufferList([
|
||||
new BufferList([
|
||||
new BufferList(Buffer.from('abc')),
|
||||
Buffer.from('d'),
|
||||
new BufferList(Buffer.from('efg'))
|
||||
]),
|
||||
new BufferList([Buffer.from('hi')]),
|
||||
new BufferList(Buffer.from('j'))
|
||||
]))
|
||||
|
||||
t.equal(bl.length, 10)
|
||||
|
||||
t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
|
||||
|
||||
t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
|
||||
t.equal(bl.slice(3, 6).toString('ascii'), 'def')
|
||||
t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
|
||||
t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('append accepts arrays of Buffers', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('abc'))
|
||||
bl.append([Buffer.from('def')])
|
||||
bl.append([Buffer.from('ghi'), Buffer.from('jkl')])
|
||||
bl.append([Buffer.from('mnop'), Buffer.from('qrstu'), Buffer.from('vwxyz')])
|
||||
t.equal(bl.length, 26)
|
||||
t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('append accepts arrays of Uint8Arrays', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(new Uint8Array([97, 98, 99]))
|
||||
bl.append([Uint8Array.from([100, 101, 102])])
|
||||
bl.append([new Uint8Array([103, 104, 105]), new Uint8Array([106, 107, 108])])
|
||||
bl.append([new Uint8Array([109, 110, 111, 112]), new Uint8Array([113, 114, 115, 116, 117]), new Uint8Array([118, 119, 120, 121, 122])])
|
||||
t.equal(bl.length, 26)
|
||||
t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('append accepts arrays of BufferLists', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('abc'))
|
||||
bl.append([new BufferList('def')])
|
||||
bl.append(new BufferList([Buffer.from('ghi'), new BufferList('jkl')]))
|
||||
bl.append([Buffer.from('mnop'), new BufferList([Buffer.from('qrstu'), Buffer.from('vwxyz')])])
|
||||
t.equal(bl.length, 26)
|
||||
t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('append chainable', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
t.ok(bl.append(Buffer.from('abcd')) === bl)
|
||||
t.ok(bl.append([Buffer.from('abcd')]) === bl)
|
||||
t.ok(bl.append(new BufferList(Buffer.from('abcd'))) === bl)
|
||||
t.ok(bl.append([new BufferList(Buffer.from('abcd'))]) === bl)
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('append chainable (test results)', function (t) {
|
||||
const bl = new BufferList('abc')
|
||||
.append([new BufferList('def')])
|
||||
.append(new BufferList([Buffer.from('ghi'), new BufferList('jkl')]))
|
||||
.append([Buffer.from('mnop'), new BufferList([Buffer.from('qrstu'), Buffer.from('vwxyz')])])
|
||||
|
||||
t.equal(bl.length, 26)
|
||||
t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('consuming from multiple buffers', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('abcd'))
|
||||
bl.append(Buffer.from('efg'))
|
||||
bl.append(Buffer.from('hi'))
|
||||
bl.append(Buffer.from('j'))
|
||||
|
||||
t.equal(bl.length, 10)
|
||||
|
||||
t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
|
||||
|
||||
bl.consume(3)
|
||||
t.equal(bl.length, 7)
|
||||
t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
|
||||
|
||||
bl.consume(2)
|
||||
t.equal(bl.length, 5)
|
||||
t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
|
||||
|
||||
bl.consume(1)
|
||||
t.equal(bl.length, 4)
|
||||
t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
|
||||
|
||||
bl.consume(1)
|
||||
t.equal(bl.length, 3)
|
||||
t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
|
||||
|
||||
bl.consume(2)
|
||||
t.equal(bl.length, 1)
|
||||
t.equal(bl.slice(0, 1).toString('ascii'), 'j')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('complete consumption', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('a'))
|
||||
bl.append(Buffer.from('b'))
|
||||
|
||||
bl.consume(2)
|
||||
|
||||
t.equal(bl.length, 0)
|
||||
t.equal(bl._bufs.length, 0)
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test readUInt8 / readInt8', function (t) {
|
||||
const buf1 = Buffer.alloc(1)
|
||||
const buf2 = Buffer.alloc(3)
|
||||
const buf3 = Buffer.alloc(3)
|
||||
const bl = new BufferList()
|
||||
|
||||
buf1[0] = 0x1
|
||||
buf2[1] = 0x3
|
||||
buf2[2] = 0x4
|
||||
buf3[0] = 0x23
|
||||
buf3[1] = 0x42
|
||||
|
||||
bl.append(buf1)
|
||||
bl.append(buf2)
|
||||
bl.append(buf3)
|
||||
|
||||
t.equal(bl.readUInt8(), 0x1)
|
||||
t.equal(bl.readUInt8(2), 0x3)
|
||||
t.equal(bl.readInt8(2), 0x3)
|
||||
t.equal(bl.readUInt8(3), 0x4)
|
||||
t.equal(bl.readInt8(3), 0x4)
|
||||
t.equal(bl.readUInt8(4), 0x23)
|
||||
t.equal(bl.readInt8(4), 0x23)
|
||||
t.equal(bl.readUInt8(5), 0x42)
|
||||
t.equal(bl.readInt8(5), 0x42)
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
|
||||
const buf1 = Buffer.alloc(1)
|
||||
const buf2 = Buffer.alloc(3)
|
||||
const buf3 = Buffer.alloc(3)
|
||||
const bl = new BufferList()
|
||||
|
||||
buf1[0] = 0x1
|
||||
buf2[1] = 0x3
|
||||
buf2[2] = 0x4
|
||||
buf3[0] = 0x23
|
||||
buf3[1] = 0x42
|
||||
|
||||
bl.append(buf1)
|
||||
bl.append(buf2)
|
||||
bl.append(buf3)
|
||||
|
||||
t.equal(bl.readUInt16BE(), 0x0100)
|
||||
t.equal(bl.readUInt16LE(), 0x0001)
|
||||
t.equal(bl.readUInt16BE(2), 0x0304)
|
||||
t.equal(bl.readUInt16LE(2), 0x0403)
|
||||
t.equal(bl.readInt16BE(2), 0x0304)
|
||||
t.equal(bl.readInt16LE(2), 0x0403)
|
||||
t.equal(bl.readUInt16BE(3), 0x0423)
|
||||
t.equal(bl.readUInt16LE(3), 0x2304)
|
||||
t.equal(bl.readInt16BE(3), 0x0423)
|
||||
t.equal(bl.readInt16LE(3), 0x2304)
|
||||
t.equal(bl.readUInt16BE(4), 0x2342)
|
||||
t.equal(bl.readUInt16LE(4), 0x4223)
|
||||
t.equal(bl.readInt16BE(4), 0x2342)
|
||||
t.equal(bl.readInt16LE(4), 0x4223)
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
|
||||
const buf1 = Buffer.alloc(1)
|
||||
const buf2 = Buffer.alloc(3)
|
||||
const buf3 = Buffer.alloc(3)
|
||||
const bl = new BufferList()
|
||||
|
||||
buf1[0] = 0x1
|
||||
buf2[1] = 0x3
|
||||
buf2[2] = 0x4
|
||||
buf3[0] = 0x23
|
||||
buf3[1] = 0x42
|
||||
|
||||
bl.append(buf1)
|
||||
bl.append(buf2)
|
||||
bl.append(buf3)
|
||||
|
||||
t.equal(bl.readUInt32BE(), 0x01000304)
|
||||
t.equal(bl.readUInt32LE(), 0x04030001)
|
||||
t.equal(bl.readUInt32BE(2), 0x03042342)
|
||||
t.equal(bl.readUInt32LE(2), 0x42230403)
|
||||
t.equal(bl.readInt32BE(2), 0x03042342)
|
||||
t.equal(bl.readInt32LE(2), 0x42230403)
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test readUIntLE / readUIntBE / readIntLE / readIntBE', function (t) {
|
||||
const buf1 = Buffer.alloc(1)
|
||||
const buf2 = Buffer.alloc(3)
|
||||
const buf3 = Buffer.alloc(3)
|
||||
const bl = new BufferList()
|
||||
|
||||
buf2[0] = 0x2
|
||||
buf2[1] = 0x3
|
||||
buf2[2] = 0x4
|
||||
buf3[0] = 0x23
|
||||
buf3[1] = 0x42
|
||||
buf3[2] = 0x61
|
||||
|
||||
bl.append(buf1)
|
||||
bl.append(buf2)
|
||||
bl.append(buf3)
|
||||
|
||||
t.equal(bl.readUIntBE(1, 1), 0x02)
|
||||
t.equal(bl.readUIntBE(1, 2), 0x0203)
|
||||
t.equal(bl.readUIntBE(1, 3), 0x020304)
|
||||
t.equal(bl.readUIntBE(1, 4), 0x02030423)
|
||||
t.equal(bl.readUIntBE(1, 5), 0x0203042342)
|
||||
t.equal(bl.readUIntBE(1, 6), 0x020304234261)
|
||||
t.equal(bl.readUIntLE(1, 1), 0x02)
|
||||
t.equal(bl.readUIntLE(1, 2), 0x0302)
|
||||
t.equal(bl.readUIntLE(1, 3), 0x040302)
|
||||
t.equal(bl.readUIntLE(1, 4), 0x23040302)
|
||||
t.equal(bl.readUIntLE(1, 5), 0x4223040302)
|
||||
t.equal(bl.readUIntLE(1, 6), 0x614223040302)
|
||||
t.equal(bl.readIntBE(1, 1), 0x02)
|
||||
t.equal(bl.readIntBE(1, 2), 0x0203)
|
||||
t.equal(bl.readIntBE(1, 3), 0x020304)
|
||||
t.equal(bl.readIntBE(1, 4), 0x02030423)
|
||||
t.equal(bl.readIntBE(1, 5), 0x0203042342)
|
||||
t.equal(bl.readIntBE(1, 6), 0x020304234261)
|
||||
t.equal(bl.readIntLE(1, 1), 0x02)
|
||||
t.equal(bl.readIntLE(1, 2), 0x0302)
|
||||
t.equal(bl.readIntLE(1, 3), 0x040302)
|
||||
t.equal(bl.readIntLE(1, 4), 0x23040302)
|
||||
t.equal(bl.readIntLE(1, 5), 0x4223040302)
|
||||
t.equal(bl.readIntLE(1, 6), 0x614223040302)
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test readFloatLE / readFloatBE', function (t) {
|
||||
const buf1 = Buffer.alloc(1)
|
||||
const buf2 = Buffer.alloc(3)
|
||||
const buf3 = Buffer.alloc(3)
|
||||
const bl = new BufferList()
|
||||
|
||||
buf1[0] = 0x01
|
||||
buf2[1] = 0x00
|
||||
buf2[2] = 0x00
|
||||
buf3[0] = 0x80
|
||||
buf3[1] = 0x3f
|
||||
|
||||
bl.append(buf1)
|
||||
bl.append(buf2)
|
||||
bl.append(buf3)
|
||||
|
||||
const canonical = Buffer.concat([buf1, buf2, buf3])
|
||||
t.equal(bl.readFloatLE(), canonical.readFloatLE())
|
||||
t.equal(bl.readFloatBE(), canonical.readFloatBE())
|
||||
t.equal(bl.readFloatLE(2), canonical.readFloatLE(2))
|
||||
t.equal(bl.readFloatBE(2), canonical.readFloatBE(2))
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test readDoubleLE / readDoubleBE', function (t) {
|
||||
const buf1 = Buffer.alloc(1)
|
||||
const buf2 = Buffer.alloc(3)
|
||||
const buf3 = Buffer.alloc(10)
|
||||
const bl = new BufferList()
|
||||
|
||||
buf1[0] = 0x01
|
||||
buf2[1] = 0x55
|
||||
buf2[2] = 0x55
|
||||
buf3[0] = 0x55
|
||||
buf3[1] = 0x55
|
||||
buf3[2] = 0x55
|
||||
buf3[3] = 0x55
|
||||
buf3[4] = 0xd5
|
||||
buf3[5] = 0x3f
|
||||
|
||||
bl.append(buf1)
|
||||
bl.append(buf2)
|
||||
bl.append(buf3)
|
||||
|
||||
const canonical = Buffer.concat([buf1, buf2, buf3])
|
||||
t.equal(bl.readDoubleBE(), canonical.readDoubleBE())
|
||||
t.equal(bl.readDoubleLE(), canonical.readDoubleLE())
|
||||
t.equal(bl.readDoubleBE(2), canonical.readDoubleBE(2))
|
||||
t.equal(bl.readDoubleLE(2), canonical.readDoubleLE(2))
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test toString', function (t) {
|
||||
const bl = new BufferList()
|
||||
|
||||
bl.append(Buffer.from('abcd'))
|
||||
bl.append(Buffer.from('efg'))
|
||||
bl.append(Buffer.from('hi'))
|
||||
bl.append(Buffer.from('j'))
|
||||
|
||||
t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
|
||||
t.equal(bl.toString('ascii', 3, 10), 'defghij')
|
||||
t.equal(bl.toString('ascii', 3, 6), 'def')
|
||||
t.equal(bl.toString('ascii', 3, 8), 'defgh')
|
||||
t.equal(bl.toString('ascii', 5, 10), 'fghij')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test toString encoding', function (t) {
|
||||
const bl = new BufferList()
|
||||
const b = Buffer.from('abcdefghij\xff\x00')
|
||||
|
||||
bl.append(Buffer.from('abcd'))
|
||||
bl.append(Buffer.from('efg'))
|
||||
bl.append(Buffer.from('hi'))
|
||||
bl.append(Buffer.from('j'))
|
||||
bl.append(Buffer.from('\xff\x00'))
|
||||
|
||||
encodings.forEach(function (enc) {
|
||||
t.equal(bl.toString(enc), b.toString(enc), enc)
|
||||
})
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('uninitialized memory', function (t) {
|
||||
const secret = crypto.randomBytes(256)
|
||||
for (let i = 0; i < 1e6; i++) {
|
||||
const clone = Buffer.from(secret)
|
||||
const bl = new BufferList()
|
||||
bl.append(Buffer.from('a'))
|
||||
bl.consume(-1024)
|
||||
const buf = bl.slice(1)
|
||||
if (buf.indexOf(clone) !== -1) {
|
||||
t.fail(`Match (at ${i})`)
|
||||
break
|
||||
}
|
||||
}
|
||||
t.end()
|
||||
})
|
||||
|
||||
!process.browser && tape('test stream', function (t) {
|
||||
const random = crypto.randomBytes(65534)
|
||||
|
||||
const bl = new BufferList((err, buf) => {
|
||||
t.ok(Buffer.isBuffer(buf))
|
||||
t.ok(err === null)
|
||||
t.ok(random.equals(bl.slice()))
|
||||
t.ok(random.equals(buf.slice()))
|
||||
|
||||
bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
|
||||
.on('close', function () {
|
||||
const rndhash = crypto.createHash('md5').update(random).digest('hex')
|
||||
const md5sum = crypto.createHash('md5')
|
||||
const s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
|
||||
|
||||
s.on('data', md5sum.update.bind(md5sum))
|
||||
s.on('end', function () {
|
||||
t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
|
||||
fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
|
||||
})
|
||||
|
||||
tape('instantiation with Buffer', function (t) {
|
||||
const buf = crypto.randomBytes(1024)
|
||||
const buf2 = crypto.randomBytes(1024)
|
||||
let b = BufferList(buf)
|
||||
|
||||
t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
|
||||
b = BufferList([buf, buf2])
|
||||
t.equal(b.slice().toString('hex'), Buffer.concat([buf, buf2]).toString('hex'), 'same buffer')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test String appendage', function (t) {
|
||||
const bl = new BufferList()
|
||||
const b = Buffer.from('abcdefghij\xff\x00')
|
||||
|
||||
bl.append('abcd')
|
||||
bl.append('efg')
|
||||
bl.append('hi')
|
||||
bl.append('j')
|
||||
bl.append('\xff\x00')
|
||||
|
||||
encodings.forEach(function (enc) {
|
||||
t.equal(bl.toString(enc), b.toString(enc))
|
||||
})
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('test Number appendage', function (t) {
|
||||
const bl = new BufferList()
|
||||
const b = Buffer.from('1234567890')
|
||||
|
||||
bl.append(1234)
|
||||
bl.append(567)
|
||||
bl.append(89)
|
||||
bl.append(0)
|
||||
|
||||
encodings.forEach(function (enc) {
|
||||
t.equal(bl.toString(enc), b.toString(enc))
|
||||
})
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('write nothing, should get empty buffer', function (t) {
|
||||
t.plan(3)
|
||||
BufferList(function (err, data) {
|
||||
t.notOk(err, 'no error')
|
||||
t.ok(Buffer.isBuffer(data), 'got a buffer')
|
||||
t.equal(0, data.length, 'got a zero-length buffer')
|
||||
t.end()
|
||||
}).end()
|
||||
})
|
||||
|
||||
tape('unicode string', function (t) {
|
||||
t.plan(2)
|
||||
|
||||
const inp1 = '\u2600'
|
||||
const inp2 = '\u2603'
|
||||
const exp = inp1 + ' and ' + inp2
|
||||
const bl = BufferList()
|
||||
|
||||
bl.write(inp1)
|
||||
bl.write(' and ')
|
||||
bl.write(inp2)
|
||||
t.equal(exp, bl.toString())
|
||||
t.equal(Buffer.from(exp).toString('hex'), bl.toString('hex'))
|
||||
})
|
||||
|
||||
tape('should emit finish', function (t) {
|
||||
const source = BufferList()
|
||||
const dest = BufferList()
|
||||
|
||||
source.write('hello')
|
||||
source.pipe(dest)
|
||||
|
||||
dest.on('finish', function () {
|
||||
t.equal(dest.toString('utf8'), 'hello')
|
||||
t.end()
|
||||
})
|
||||
})
|
||||
|
||||
tape('basic copy', function (t) {
|
||||
const buf = crypto.randomBytes(1024)
|
||||
const buf2 = Buffer.alloc(1024)
|
||||
const b = BufferList(buf)
|
||||
|
||||
b.copy(buf2)
|
||||
t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('copy after many appends', function (t) {
|
||||
const buf = crypto.randomBytes(512)
|
||||
const buf2 = Buffer.alloc(1024)
|
||||
const b = BufferList(buf)
|
||||
|
||||
b.append(buf)
|
||||
b.copy(buf2)
|
||||
t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('copy at a precise position', function (t) {
|
||||
const buf = crypto.randomBytes(1004)
|
||||
const buf2 = Buffer.alloc(1024)
|
||||
const b = BufferList(buf)
|
||||
|
||||
b.copy(buf2, 20)
|
||||
t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('copy starting from a precise location', function (t) {
|
||||
const buf = crypto.randomBytes(10)
|
||||
const buf2 = Buffer.alloc(5)
|
||||
const b = BufferList(buf)
|
||||
|
||||
b.copy(buf2, 0, 5)
|
||||
t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('copy in an interval', function (t) {
|
||||
const rnd = crypto.randomBytes(10)
|
||||
const b = BufferList(rnd) // put the random bytes there
|
||||
const actual = Buffer.alloc(3)
|
||||
const expected = Buffer.alloc(3)
|
||||
|
||||
rnd.copy(expected, 0, 5, 8)
|
||||
b.copy(actual, 0, 5, 8)
|
||||
|
||||
t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('copy an interval between two buffers', function (t) {
|
||||
const buf = crypto.randomBytes(10)
|
||||
const buf2 = Buffer.alloc(10)
|
||||
const b = BufferList(buf)
|
||||
|
||||
b.append(buf)
|
||||
b.copy(buf2, 0, 5, 15)
|
||||
|
||||
t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('shallow slice across buffer boundaries', function (t) {
|
||||
const bl = new BufferList(['First', 'Second', 'Third'])
|
||||
|
||||
t.equal(bl.shallowSlice(3, 13).toString(), 'stSecondTh')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('shallow slice within single buffer', function (t) {
|
||||
t.plan(2)
|
||||
|
||||
const bl = new BufferList(['First', 'Second', 'Third'])
|
||||
|
||||
t.equal(bl.shallowSlice(5, 10).toString(), 'Secon')
|
||||
t.equal(bl.shallowSlice(7, 10).toString(), 'con')
|
||||
|
||||
t.end()
|
||||
})
|
||||
|
||||
tape('shallow slice single buffer', function (t) {
|
||||
t.plan(3)
|
||||
|
||||
const bl = new BufferList(['First', 'Second', 'Third'])
|
||||
|
||||
t.equal(bl.shallowSlice(0, 5).toString(), 'First')
|
||||
t.equal(bl.shallowSlice(5, 11).toString(), 'Second')
|
||||
t.equal(bl.shallowSlice(11, 16).toString(), 'Third')
|
||||
})
|
||||
|
||||
tape('shallow slice with negative or omitted indices', function (t) {
|
||||
t.plan(4)
|
||||
|
||||
const bl = new BufferList(['First', 'Second', 'Third'])
|
||||
|
||||
t.equal(bl.shallowSlice().toString(), 'FirstSecondThird')
|
||||
t.equal(bl.shallowSlice(5).toString(), 'SecondThird')
|
||||
t.equal(bl.shallowSlice(5, -3).toString(), 'SecondTh')
|
||||
t.equal(bl.shallowSlice(-8).toString(), 'ondThird')
|
||||
})
|
||||
|
||||
tape('shallow slice does not make a copy', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
|
||||
const bl = (new BufferList(buffers)).shallowSlice(5, -3)
|
||||
|
||||
buffers[1].fill('h')
|
||||
buffers[2].fill('h')
|
||||
|
||||
t.equal(bl.toString(), 'hhhhhhhh')
|
||||
})
|
||||
|
||||
tape('shallow slice with 0 length', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
|
||||
const bl = (new BufferList(buffers)).shallowSlice(0, 0)
|
||||
|
||||
t.equal(bl.length, 0)
|
||||
})
|
||||
|
||||
tape('shallow slice with 0 length from middle', function (t) {
|
||||
t.plan(1)
|
||||
|
||||
const buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
|
||||
const bl = (new BufferList(buffers)).shallowSlice(10, 10)
|
||||
|
||||
t.equal(bl.length, 0)
|
||||
})
|
||||
|
||||
tape('duplicate', function (t) {
|
||||
t.plan(2)
|
||||
|
||||
const bl = new BufferList('abcdefghij\xff\x00')
|
||||
const dup = bl.duplicate()
|
||||
|
||||
t.equal(bl.prototype, dup.prototype)
|
||||
t.equal(bl.toString('hex'), dup.toString('hex'))
|
||||
})
|
||||
|
||||
tape('destroy no pipe', function (t) {
|
||||
t.plan(2)
|
||||
|
||||
const bl = new BufferList('alsdkfja;lsdkfja;lsdk')
|
||||
|
||||
bl.destroy()
|
||||
|
||||
t.equal(bl._bufs.length, 0)
|
||||
t.equal(bl.length, 0)
|
||||
})
|
||||
|
||||
tape('destroy with error', function (t) {
|
||||
t.plan(3)
|
||||
|
||||
const bl = new BufferList('alsdkfja;lsdkfja;lsdk')
|
||||
const err = new Error('kaboom')
|
||||
|
||||
bl.destroy(err)
|
||||
bl.on('error', function (_err) {
|
||||
t.equal(_err, err)
|
||||
})
|
||||
|
||||
t.equal(bl._bufs.length, 0)
|
||||
t.equal(bl.length, 0)
|
||||
})
|
||||
|
||||
!process.browser && tape('destroy with pipe before read end', function (t) {
|
||||
t.plan(2)
|
||||
|
||||
const bl = new BufferList()
|
||||
fs.createReadStream(path.join(__dirname, '/test.js'))
|
||||
.pipe(bl)
|
||||
|
||||
bl.destroy()
|
||||
|
||||
t.equal(bl._bufs.length, 0)
|
||||
t.equal(bl.length, 0)
|
||||
})
|
||||
|
||||
!process.browser && tape('destroy with pipe before read end with race', function (t) {
|
||||
t.plan(2)
|
||||
|
||||
const bl = new BufferList()
|
||||
|
||||
fs.createReadStream(path.join(__dirname, '/test.js'))
|
||||
.pipe(bl)
|
||||
|
||||
setTimeout(function () {
|
||||
bl.destroy()
|
||||
setTimeout(function () {
|
||||
t.equal(bl._bufs.length, 0)
|
||||
t.equal(bl.length, 0)
|
||||
}, 500)
|
||||
}, 500)
|
||||
})
|
||||
|
||||
!process.browser && tape('destroy with pipe after read end', function (t) {
|
||||
t.plan(2)
|
||||
|
||||
const bl = new BufferList()
|
||||
|
||||
fs.createReadStream(path.join(__dirname, '/test.js'))
|
||||
.on('end', onEnd)
|
||||
.pipe(bl)
|
||||
|
||||
function onEnd () {
|
||||
bl.destroy()
|
||||
|
||||
t.equal(bl._bufs.length, 0)
|
||||
t.equal(bl.length, 0)
|
||||
}
|
||||
})
|
||||
|
||||
!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
|
||||
t.plan(4)
|
||||
|
||||
const bl = new BufferList()
|
||||
const ds = new BufferList()
|
||||
|
||||
fs.createReadStream(path.join(__dirname, '/test.js'))
|
||||
.on('end', onEnd)
|
||||
.pipe(bl)
|
||||
|
||||
function onEnd () {
|
||||
bl.pipe(ds)
|
||||
|
||||
setTimeout(function () {
|
||||
bl.destroy()
|
||||
|
||||
t.equals(bl._bufs.length, 0)
|
||||
t.equals(bl.length, 0)
|
||||
|
||||
ds.destroy()
|
||||
|
||||
t.equals(bl._bufs.length, 0)
|
||||
t.equals(bl.length, 0)
|
||||
}, 100)
|
||||
}
|
||||
})
|
||||
|
||||
!process.browser && tape('handle error', function (t) {
|
||||
t.plan(2)
|
||||
|
||||
fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
|
||||
t.ok(err instanceof Error, 'has error')
|
||||
t.notOk(data, 'no data')
|
||||
}))
|
||||
})
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="40"
|
||||
height="40"
|
||||
viewBox="0 0 40 40">
|
||||
<g
|
||||
transform="translate(0,-60)"
|
||||
id="layer1">
|
||||
<rect
|
||||
width="36.460953"
|
||||
height="34.805603"
|
||||
x="1.7695236"
|
||||
y="62.597198"
|
||||
style="fill:#ffff00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.30826771;stroke-opacity:1" />
|
||||
<g
|
||||
transform="matrix(0.88763677,0,0,0.88763677,2.2472646,8.9890584)">
|
||||
<path
|
||||
d="M 20,64.526342 C 11.454135,64.526342 4.5263421,71.454135 4.5263421,80 4.5263421,88.545865 11.454135,95.473658 20,95.473658 28.545865,95.473658 35.473658,88.545865 35.473658,80 35.473658,71.454135 28.545865,64.526342 20,64.526342 z m -0.408738,9.488564 c 3.527079,0 6.393832,2.84061 6.393832,6.335441 0,3.494831 -2.866753,6.335441 -6.393832,6.335441 -3.527079,0 -6.393832,-2.84061 -6.393832,-6.335441 0,-3.494831 2.866753,-6.335441 6.393832,-6.335441 z"
|
||||
style="fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:1.02768445;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
|
||||
<path
|
||||
d="m 7.2335209,71.819938 4.9702591,4.161823 c -1.679956,2.581606 -1.443939,6.069592 0.159325,8.677725 l -5.1263071,3.424463 c 0.67516,1.231452 3.0166401,3.547686 4.2331971,4.194757 l 3.907728,-4.567277 c 2.541952,1.45975 5.730694,1.392161 8.438683,-0.12614 l 3.469517,6.108336 c 1.129779,-0.44367 4.742234,-3.449633 5.416358,-5.003859 l -5.46204,-4.415541 c 1.44319,-2.424098 1.651175,-5.267515 0.557303,-7.748623 l 5.903195,-3.833951 C 33.14257,71.704996 30.616217,69.018606 29.02952,67.99296 l -4.118813,4.981678 C 22.411934,71.205099 18.900853,70.937534 16.041319,72.32916 l -3.595408,-5.322091 c -1.345962,0.579488 -4.1293881,2.921233 -5.2123901,4.812869 z m 8.1010311,3.426672 c 2.75284,-2.446266 6.769149,-2.144694 9.048998,0.420874 2.279848,2.56557 2.113919,6.596919 -0.638924,9.043185 -2.752841,2.446267 -6.775754,2.13726 -9.055604,-0.428308 -2.279851,-2.565568 -2.107313,-6.589485 0.64553,-9.035751 z"
|
||||
style="fill:#000000;fill-opacity:1;stroke:none" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.1 KiB |
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"K D E F A B mC"},B:{"2":"C L M G N","33":"0 9 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I","129":"O P"},C:{"2":"1 2 3 4 5 6 7 8 nC LC J PB K D E F A B C L M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B qC rC","33":"0 9 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC oC pC"},D:{"16":"J PB K D E F A B C L","33":"0 1 2 3 4 5 6 7 8 9 M G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB MC wB NC xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB I PC EC QC RC"},E:{"2":"J sC SC","33":"PB K D E F A B C L M G tC uC vC wC TC FC GC xC yC zC UC VC HC 0C IC WC XC YC ZC aC 1C JC bC cC dC eC fC 2C KC gC hC iC jC 3C"},F:{"2":"F B C 4C 5C 6C 7C FC kC 8C GC","33":"0 1 2 3 4 5 6 7 8 G N O P QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC Q H R OC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"2":"SC 9C lC","33":"E AD BD CD DD ED FD GD HD ID JD KD LD MD ND OD PD QD RD SD UC VC HC TD IC WC XC YC ZC aC UD JC bC cC dC eC fC VD KC gC hC iC jC"},H:{"2":"WD"},I:{"16":"XD YD","33":"LC J I ZD aD lC bD cD"},J:{"33":"D A"},K:{"2":"A B C FC kC GC","33":"H"},L:{"33":"I"},M:{"33":"EC"},N:{"2":"A B"},O:{"33":"HC"},P:{"33":"1 2 3 4 5 6 7 8 J dD eD fD gD hD TC iD jD kD lD mD IC JC KC nD"},Q:{"33":"oD"},R:{"33":"pD"},S:{"2":"qD","33":"rD"}},B:5,C:"CSS line-clamp",D:true};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"root.cjs","sources":["../../src/root.ts"],"sourcesContent":["export const rootRouteId = '__root__'\nexport type RootRouteId = typeof rootRouteId\n"],"names":[],"mappings":";;AAAO,MAAM,cAAc;;"}
|
||||
@@ -0,0 +1,115 @@
|
||||
# flatted
|
||||
|
||||
[](https://www.npmjs.com/package/flatted) [](https://coveralls.io/github/WebReflection/flatted?branch=main) [](https://travis-ci.com/WebReflection/flatted) [](https://opensource.org/licenses/ISC) 
|
||||
|
||||

|
||||
|
||||
<sup>**Social Media Photo by [Matt Seymour](https://unsplash.com/@mattseymour) on [Unsplash](https://unsplash.com/)**</sup>
|
||||
|
||||
A super light (0.5K) and fast circular JSON parser, directly from the creator of [CircularJSON](https://github.com/WebReflection/circular-json/#circularjson).
|
||||
|
||||
Available also for **[PHP](./php/flatted.php)**.
|
||||
|
||||
Available also for **[Python](./python/flatted.py)**.
|
||||
|
||||
- - -
|
||||
|
||||
## Announcement 📣
|
||||
|
||||
There is a standard approach to recursion and more data-types than what JSON allows, and it's part of the [Structured Clone polyfill](https://github.com/ungap/structured-clone/#readme).
|
||||
|
||||
Beside acting as a polyfill, its `@ungap/structured-clone/json` export provides both `stringify` and `parse`, and it's been tested for being faster than *flatted*, but its produced output is also smaller than *flatted* in general.
|
||||
|
||||
The *@ungap/structured-clone* module is, in short, a drop in replacement for *flatted*, but it's not compatible with *flatted* specialized syntax.
|
||||
|
||||
However, if recursion, as well as more data-types, are what you are after, or interesting for your projects/use cases, consider switching to this new module whenever you can 👍
|
||||
|
||||
- - -
|
||||
|
||||
```js
|
||||
npm i flatted
|
||||
```
|
||||
|
||||
Usable via [CDN](https://unpkg.com/flatted) or as regular module.
|
||||
|
||||
```js
|
||||
// ESM
|
||||
import {parse, stringify, toJSON, fromJSON} from 'flatted';
|
||||
|
||||
// CJS
|
||||
const {parse, stringify, toJSON, fromJSON} = require('flatted');
|
||||
|
||||
const a = [{}];
|
||||
a[0].a = a;
|
||||
a.push(a);
|
||||
|
||||
stringify(a); // [["1","0"],{"a":"0"}]
|
||||
```
|
||||
|
||||
## toJSON and fromJSON
|
||||
|
||||
If you'd like to implicitly survive JSON serialization, these two helpers helps:
|
||||
|
||||
```js
|
||||
import {toJSON, fromJSON} from 'flatted';
|
||||
|
||||
class RecursiveMap extends Map {
|
||||
static fromJSON(any) {
|
||||
return new this(fromJSON(any));
|
||||
}
|
||||
toJSON() {
|
||||
return toJSON([...this.entries()]);
|
||||
}
|
||||
}
|
||||
|
||||
const recursive = new RecursiveMap;
|
||||
const same = {};
|
||||
same.same = same;
|
||||
recursive.set('same', same);
|
||||
|
||||
const asString = JSON.stringify(recursive);
|
||||
const asMap = RecursiveMap.fromJSON(JSON.parse(asString));
|
||||
asMap.get('same') === asMap.get('same').same;
|
||||
// true
|
||||
```
|
||||
|
||||
|
||||
## Flatted VS JSON
|
||||
|
||||
As it is for every other specialized format capable of serializing and deserializing circular data, you should never `JSON.parse(Flatted.stringify(data))`, and you should never `Flatted.parse(JSON.stringify(data))`.
|
||||
|
||||
The only way this could work is to `Flatted.parse(Flatted.stringify(data))`, as it is also for _CircularJSON_ or any other, otherwise there's no granted data integrity.
|
||||
|
||||
Also please note this project serializes and deserializes only data compatible with JSON, so that sockets, or anything else with internal classes different from those allowed by JSON standard, won't be serialized and unserialized as expected.
|
||||
|
||||
|
||||
### New in V1: Exact same JSON API
|
||||
|
||||
* Added a [reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Syntax) parameter to `.parse(string, reviver)` and revive your own objects.
|
||||
* Added a [replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Syntax) and a `space` parameter to `.stringify(object, replacer, space)` for feature parity with JSON signature.
|
||||
|
||||
|
||||
### Compatibility
|
||||
All ECMAScript engines compatible with `Map`, `Set`, `Object.keys`, and `Array.prototype.reduce` will work, even if polyfilled.
|
||||
|
||||
|
||||
### How does it work ?
|
||||
While stringifying, all Objects, including Arrays, and strings, are flattened out and replaced as unique index. `*`
|
||||
|
||||
Once parsed, all indexes will be replaced through the flattened collection.
|
||||
|
||||
<sup><sub>`*` represented as string to avoid conflicts with numbers</sub></sup>
|
||||
|
||||
```js
|
||||
// logic example
|
||||
var a = [{one: 1}, {two: '2'}];
|
||||
a[0].a = a;
|
||||
// a is the main object, will be at index '0'
|
||||
// {one: 1} is the second object, index '1'
|
||||
// {two: '2'} the third, in '2', and it has a string
|
||||
// which will be found at index '3'
|
||||
|
||||
Flatted.stringify(a);
|
||||
// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"]
|
||||
// a[one,two] {one: 1, a} {two: '2'} '2'
|
||||
```
|
||||
@@ -0,0 +1,301 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.LogicalExpression = exports.BinaryExpression = exports.AssignmentExpression = AssignmentExpression;
|
||||
exports.AssignmentPattern = AssignmentPattern;
|
||||
exports.AwaitExpression = AwaitExpression;
|
||||
exports.BindExpression = BindExpression;
|
||||
exports.CallExpression = CallExpression;
|
||||
exports.ConditionalExpression = ConditionalExpression;
|
||||
exports.Decorator = Decorator;
|
||||
exports.DoExpression = DoExpression;
|
||||
exports.EmptyStatement = EmptyStatement;
|
||||
exports.ExpressionStatement = ExpressionStatement;
|
||||
exports.Import = Import;
|
||||
exports.MemberExpression = MemberExpression;
|
||||
exports.MetaProperty = MetaProperty;
|
||||
exports.ModuleExpression = ModuleExpression;
|
||||
exports.NewExpression = NewExpression;
|
||||
exports.OptionalCallExpression = OptionalCallExpression;
|
||||
exports.OptionalMemberExpression = OptionalMemberExpression;
|
||||
exports.ParenthesizedExpression = ParenthesizedExpression;
|
||||
exports.PrivateName = PrivateName;
|
||||
exports.SequenceExpression = SequenceExpression;
|
||||
exports.Super = Super;
|
||||
exports.ThisExpression = ThisExpression;
|
||||
exports.UnaryExpression = UnaryExpression;
|
||||
exports.UpdateExpression = UpdateExpression;
|
||||
exports.V8IntrinsicIdentifier = V8IntrinsicIdentifier;
|
||||
exports.YieldExpression = YieldExpression;
|
||||
exports._shouldPrintDecoratorsBeforeExport = _shouldPrintDecoratorsBeforeExport;
|
||||
var _t = require("@babel/types");
|
||||
var _index = require("../node/index.js");
|
||||
const {
|
||||
isCallExpression,
|
||||
isLiteral,
|
||||
isMemberExpression,
|
||||
isNewExpression,
|
||||
isPattern
|
||||
} = _t;
|
||||
function UnaryExpression(node) {
|
||||
const {
|
||||
operator
|
||||
} = node;
|
||||
if (operator === "void" || operator === "delete" || operator === "typeof" || operator === "throw") {
|
||||
this.word(operator);
|
||||
this.space();
|
||||
} else {
|
||||
this.token(operator);
|
||||
}
|
||||
this.print(node.argument);
|
||||
}
|
||||
function DoExpression(node) {
|
||||
if (node.async) {
|
||||
this.word("async", true);
|
||||
this.space();
|
||||
}
|
||||
this.word("do");
|
||||
this.space();
|
||||
this.print(node.body);
|
||||
}
|
||||
function ParenthesizedExpression(node) {
|
||||
this.tokenChar(40);
|
||||
const exit = this.enterDelimited();
|
||||
this.print(node.expression);
|
||||
exit();
|
||||
this.rightParens(node);
|
||||
}
|
||||
function UpdateExpression(node) {
|
||||
if (node.prefix) {
|
||||
this.token(node.operator);
|
||||
this.print(node.argument);
|
||||
} else {
|
||||
this.print(node.argument, true);
|
||||
this.token(node.operator);
|
||||
}
|
||||
}
|
||||
function ConditionalExpression(node) {
|
||||
this.print(node.test);
|
||||
this.space();
|
||||
this.tokenChar(63);
|
||||
this.space();
|
||||
this.print(node.consequent);
|
||||
this.space();
|
||||
this.tokenChar(58);
|
||||
this.space();
|
||||
this.print(node.alternate);
|
||||
}
|
||||
function NewExpression(node, parent) {
|
||||
this.word("new");
|
||||
this.space();
|
||||
this.print(node.callee);
|
||||
if (this.format.minified && node.arguments.length === 0 && !node.optional && !isCallExpression(parent, {
|
||||
callee: node
|
||||
}) && !isMemberExpression(parent) && !isNewExpression(parent)) {
|
||||
return;
|
||||
}
|
||||
this.print(node.typeArguments);
|
||||
{
|
||||
this.print(node.typeParameters);
|
||||
}
|
||||
if (node.optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
if (node.arguments.length === 0 && this.tokenMap && !this.tokenMap.endMatches(node, ")")) {
|
||||
return;
|
||||
}
|
||||
this.tokenChar(40);
|
||||
const exit = this.enterDelimited();
|
||||
this.printList(node.arguments, this.shouldPrintTrailingComma(")"));
|
||||
exit();
|
||||
this.rightParens(node);
|
||||
}
|
||||
function SequenceExpression(node) {
|
||||
this.printList(node.expressions);
|
||||
}
|
||||
function ThisExpression() {
|
||||
this.word("this");
|
||||
}
|
||||
function Super() {
|
||||
this.word("super");
|
||||
}
|
||||
function _shouldPrintDecoratorsBeforeExport(node) {
|
||||
if (typeof this.format.decoratorsBeforeExport === "boolean") {
|
||||
return this.format.decoratorsBeforeExport;
|
||||
}
|
||||
return typeof node.start === "number" && node.start === node.declaration.start;
|
||||
}
|
||||
function Decorator(node) {
|
||||
this.tokenChar(64);
|
||||
this.print(node.expression);
|
||||
this.newline();
|
||||
}
|
||||
function OptionalMemberExpression(node) {
|
||||
let {
|
||||
computed
|
||||
} = node;
|
||||
const {
|
||||
optional,
|
||||
property
|
||||
} = node;
|
||||
this.print(node.object);
|
||||
if (!computed && isMemberExpression(property)) {
|
||||
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
||||
}
|
||||
if (isLiteral(property) && typeof property.value === "number") {
|
||||
computed = true;
|
||||
}
|
||||
if (optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
if (computed) {
|
||||
this.tokenChar(91);
|
||||
this.print(property);
|
||||
this.tokenChar(93);
|
||||
} else {
|
||||
if (!optional) {
|
||||
this.tokenChar(46);
|
||||
}
|
||||
this.print(property);
|
||||
}
|
||||
}
|
||||
function OptionalCallExpression(node) {
|
||||
this.print(node.callee);
|
||||
{
|
||||
this.print(node.typeParameters);
|
||||
}
|
||||
if (node.optional) {
|
||||
this.token("?.");
|
||||
}
|
||||
this.print(node.typeArguments);
|
||||
this.tokenChar(40);
|
||||
const exit = this.enterDelimited();
|
||||
this.printList(node.arguments);
|
||||
exit();
|
||||
this.rightParens(node);
|
||||
}
|
||||
function CallExpression(node) {
|
||||
this.print(node.callee);
|
||||
this.print(node.typeArguments);
|
||||
{
|
||||
this.print(node.typeParameters);
|
||||
}
|
||||
this.tokenChar(40);
|
||||
const exit = this.enterDelimited();
|
||||
this.printList(node.arguments, this.shouldPrintTrailingComma(")"));
|
||||
exit();
|
||||
this.rightParens(node);
|
||||
}
|
||||
function Import() {
|
||||
this.word("import");
|
||||
}
|
||||
function AwaitExpression(node) {
|
||||
this.word("await");
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
this.printTerminatorless(node.argument);
|
||||
}
|
||||
}
|
||||
function YieldExpression(node) {
|
||||
this.word("yield", true);
|
||||
if (node.delegate) {
|
||||
this.tokenChar(42);
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
this.print(node.argument);
|
||||
}
|
||||
} else {
|
||||
if (node.argument) {
|
||||
this.space();
|
||||
this.printTerminatorless(node.argument);
|
||||
}
|
||||
}
|
||||
}
|
||||
function EmptyStatement() {
|
||||
this.semicolon(true);
|
||||
}
|
||||
function ExpressionStatement(node) {
|
||||
this.tokenContext |= _index.TokenContext.expressionStatement;
|
||||
this.print(node.expression);
|
||||
this.semicolon();
|
||||
}
|
||||
function AssignmentPattern(node) {
|
||||
this.print(node.left);
|
||||
if (node.left.type === "Identifier" || isPattern(node.left)) {
|
||||
if (node.left.optional) this.tokenChar(63);
|
||||
this.print(node.left.typeAnnotation);
|
||||
}
|
||||
this.space();
|
||||
this.tokenChar(61);
|
||||
this.space();
|
||||
this.print(node.right);
|
||||
}
|
||||
function AssignmentExpression(node) {
|
||||
this.print(node.left);
|
||||
this.space();
|
||||
if (node.operator === "in" || node.operator === "instanceof") {
|
||||
this.word(node.operator);
|
||||
} else {
|
||||
this.token(node.operator);
|
||||
this._endsWithDiv = node.operator === "/";
|
||||
}
|
||||
this.space();
|
||||
this.print(node.right);
|
||||
}
|
||||
function BindExpression(node) {
|
||||
this.print(node.object);
|
||||
this.token("::");
|
||||
this.print(node.callee);
|
||||
}
|
||||
function MemberExpression(node) {
|
||||
this.print(node.object);
|
||||
if (!node.computed && isMemberExpression(node.property)) {
|
||||
throw new TypeError("Got a MemberExpression for MemberExpression property");
|
||||
}
|
||||
let computed = node.computed;
|
||||
if (isLiteral(node.property) && typeof node.property.value === "number") {
|
||||
computed = true;
|
||||
}
|
||||
if (computed) {
|
||||
const exit = this.enterDelimited();
|
||||
this.tokenChar(91);
|
||||
this.print(node.property);
|
||||
this.tokenChar(93);
|
||||
exit();
|
||||
} else {
|
||||
this.tokenChar(46);
|
||||
this.print(node.property);
|
||||
}
|
||||
}
|
||||
function MetaProperty(node) {
|
||||
this.print(node.meta);
|
||||
this.tokenChar(46);
|
||||
this.print(node.property);
|
||||
}
|
||||
function PrivateName(node) {
|
||||
this.tokenChar(35);
|
||||
this.print(node.id);
|
||||
}
|
||||
function V8IntrinsicIdentifier(node) {
|
||||
this.tokenChar(37);
|
||||
this.word(node.name);
|
||||
}
|
||||
function ModuleExpression(node) {
|
||||
this.word("module", true);
|
||||
this.space();
|
||||
this.tokenChar(123);
|
||||
this.indent();
|
||||
const {
|
||||
body
|
||||
} = node;
|
||||
if (body.body.length || body.directives.length) {
|
||||
this.newline();
|
||||
}
|
||||
this.print(body);
|
||||
this.dedent();
|
||||
this.rightBrace(node);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=expressions.js.map
|
||||
@@ -0,0 +1,402 @@
|
||||
declare const AbortException_base: any;
|
||||
/**
|
||||
* Error used to indicate task cancellation.
|
||||
*/
|
||||
export class AbortException extends AbortException_base {
|
||||
[x: string]: any;
|
||||
constructor(msg: any);
|
||||
}
|
||||
export namespace AnnotationActionEventType {
|
||||
let E: string;
|
||||
let X: string;
|
||||
let D: string;
|
||||
let U: string;
|
||||
let Fo: string;
|
||||
let Bl: string;
|
||||
let PO: string;
|
||||
let PC: string;
|
||||
let PV: string;
|
||||
let PI: string;
|
||||
let K: string;
|
||||
let F: string;
|
||||
let V: string;
|
||||
let C: string;
|
||||
}
|
||||
export namespace AnnotationBorderStyleType {
|
||||
let SOLID: number;
|
||||
let DASHED: number;
|
||||
let BEVELED: number;
|
||||
let INSET: number;
|
||||
let UNDERLINE: number;
|
||||
}
|
||||
export namespace AnnotationEditorParamsType {
|
||||
let RESIZE: number;
|
||||
let CREATE: number;
|
||||
let FREETEXT_SIZE: number;
|
||||
let FREETEXT_COLOR: number;
|
||||
let FREETEXT_OPACITY: number;
|
||||
let INK_COLOR: number;
|
||||
let INK_THICKNESS: number;
|
||||
let INK_OPACITY: number;
|
||||
let HIGHLIGHT_COLOR: number;
|
||||
let HIGHLIGHT_DEFAULT_COLOR: number;
|
||||
let HIGHLIGHT_THICKNESS: number;
|
||||
let HIGHLIGHT_FREE: number;
|
||||
let HIGHLIGHT_SHOW_ALL: number;
|
||||
}
|
||||
export const AnnotationEditorPrefix: "pdfjs_internal_editor_";
|
||||
export namespace AnnotationEditorType {
|
||||
let DISABLE: number;
|
||||
let NONE: number;
|
||||
let FREETEXT: number;
|
||||
let HIGHLIGHT: number;
|
||||
let STAMP: number;
|
||||
let INK: number;
|
||||
}
|
||||
export namespace AnnotationFieldFlag {
|
||||
let READONLY: number;
|
||||
let REQUIRED: number;
|
||||
let NOEXPORT: number;
|
||||
let MULTILINE: number;
|
||||
let PASSWORD: number;
|
||||
let NOTOGGLETOOFF: number;
|
||||
let RADIO: number;
|
||||
let PUSHBUTTON: number;
|
||||
let COMBO: number;
|
||||
let EDIT: number;
|
||||
let SORT: number;
|
||||
let FILESELECT: number;
|
||||
let MULTISELECT: number;
|
||||
let DONOTSPELLCHECK: number;
|
||||
let DONOTSCROLL: number;
|
||||
let COMB: number;
|
||||
let RICHTEXT: number;
|
||||
let RADIOSINUNISON: number;
|
||||
let COMMITONSELCHANGE: number;
|
||||
}
|
||||
export namespace AnnotationFlag {
|
||||
export let INVISIBLE: number;
|
||||
export let HIDDEN: number;
|
||||
export let PRINT: number;
|
||||
export let NOZOOM: number;
|
||||
export let NOROTATE: number;
|
||||
export let NOVIEW: number;
|
||||
let READONLY_1: number;
|
||||
export { READONLY_1 as READONLY };
|
||||
export let LOCKED: number;
|
||||
export let TOGGLENOVIEW: number;
|
||||
export let LOCKEDCONTENTS: number;
|
||||
}
|
||||
export namespace AnnotationMode {
|
||||
let DISABLE_1: number;
|
||||
export { DISABLE_1 as DISABLE };
|
||||
export let ENABLE: number;
|
||||
export let ENABLE_FORMS: number;
|
||||
export let ENABLE_STORAGE: number;
|
||||
}
|
||||
export const AnnotationPrefix: "pdfjs_internal_id_";
|
||||
export namespace AnnotationReplyType {
|
||||
let GROUP: string;
|
||||
let REPLY: string;
|
||||
}
|
||||
export namespace AnnotationType {
|
||||
export let TEXT: number;
|
||||
export let LINK: number;
|
||||
let FREETEXT_1: number;
|
||||
export { FREETEXT_1 as FREETEXT };
|
||||
export let LINE: number;
|
||||
export let SQUARE: number;
|
||||
export let CIRCLE: number;
|
||||
export let POLYGON: number;
|
||||
export let POLYLINE: number;
|
||||
let HIGHLIGHT_1: number;
|
||||
export { HIGHLIGHT_1 as HIGHLIGHT };
|
||||
let UNDERLINE_1: number;
|
||||
export { UNDERLINE_1 as UNDERLINE };
|
||||
export let SQUIGGLY: number;
|
||||
export let STRIKEOUT: number;
|
||||
let STAMP_1: number;
|
||||
export { STAMP_1 as STAMP };
|
||||
export let CARET: number;
|
||||
let INK_1: number;
|
||||
export { INK_1 as INK };
|
||||
export let POPUP: number;
|
||||
export let FILEATTACHMENT: number;
|
||||
export let SOUND: number;
|
||||
export let MOVIE: number;
|
||||
export let WIDGET: number;
|
||||
export let SCREEN: number;
|
||||
export let PRINTERMARK: number;
|
||||
export let TRAPNET: number;
|
||||
export let WATERMARK: number;
|
||||
export let THREED: number;
|
||||
export let REDACT: number;
|
||||
}
|
||||
export function assert(cond: any, msg: any): void;
|
||||
/**
|
||||
* @type {any}
|
||||
*/
|
||||
export const BaseException: any;
|
||||
export const BASELINE_FACTOR: number;
|
||||
export function bytesToString(bytes: any): string;
|
||||
/**
|
||||
* Attempts to create a valid absolute URL.
|
||||
*
|
||||
* @param {URL|string} url - An absolute, or relative, URL.
|
||||
* @param {URL|string} [baseUrl] - An absolute URL.
|
||||
* @param {Object} [options]
|
||||
* @returns Either a valid {URL}, or `null` otherwise.
|
||||
*/
|
||||
export function createValidAbsoluteUrl(url: URL | string, baseUrl?: string | URL | undefined, options?: Object | undefined): URL | null;
|
||||
export namespace DocumentActionEventType {
|
||||
let WC: string;
|
||||
let WS: string;
|
||||
let DS: string;
|
||||
let WP: string;
|
||||
let DP: string;
|
||||
}
|
||||
export class FeatureTest {
|
||||
static get isLittleEndian(): any;
|
||||
static get isEvalSupported(): any;
|
||||
static get isOffscreenCanvasSupported(): any;
|
||||
static get platform(): any;
|
||||
static get isCSSRoundSupported(): any;
|
||||
}
|
||||
export const FONT_IDENTITY_MATRIX: number[];
|
||||
export namespace FontRenderOps {
|
||||
let BEZIER_CURVE_TO: number;
|
||||
let MOVE_TO: number;
|
||||
let LINE_TO: number;
|
||||
let QUADRATIC_CURVE_TO: number;
|
||||
let RESTORE: number;
|
||||
let SAVE: number;
|
||||
let SCALE: number;
|
||||
let TRANSFORM: number;
|
||||
let TRANSLATE: number;
|
||||
}
|
||||
declare const FormatError_base: any;
|
||||
/**
|
||||
* Error caused during parsing PDF data.
|
||||
*/
|
||||
export class FormatError extends FormatError_base {
|
||||
[x: string]: any;
|
||||
constructor(msg: any);
|
||||
}
|
||||
export function fromBase64Util(str: any): any;
|
||||
export function getModificationDate(date?: Date): string;
|
||||
export function getUuid(): string;
|
||||
export function getVerbosityLevel(): number;
|
||||
export const hexNumbers: string[];
|
||||
export const IDENTITY_MATRIX: number[];
|
||||
export namespace ImageKind {
|
||||
let GRAYSCALE_1BPP: number;
|
||||
let RGB_24BPP: number;
|
||||
let RGBA_32BPP: number;
|
||||
}
|
||||
export function info(msg: any): void;
|
||||
declare const InvalidPDFException_base: any;
|
||||
export class InvalidPDFException extends InvalidPDFException_base {
|
||||
[x: string]: any;
|
||||
constructor(msg: any);
|
||||
}
|
||||
export function isArrayEqual(arr1: any, arr2: any): boolean;
|
||||
export const isNodeJS: any;
|
||||
export const LINE_DESCENT_FACTOR: 0.35;
|
||||
export const LINE_FACTOR: 1.35;
|
||||
export const MAX_IMAGE_SIZE_TO_CACHE: 10000000;
|
||||
declare const MissingPDFException_base: any;
|
||||
export class MissingPDFException extends MissingPDFException_base {
|
||||
[x: string]: any;
|
||||
constructor(msg: any);
|
||||
}
|
||||
export function normalizeUnicode(str: any): any;
|
||||
export function objectFromMap(map: any): any;
|
||||
export function objectSize(obj: any): number;
|
||||
export namespace OPS {
|
||||
let dependency: number;
|
||||
let setLineWidth: number;
|
||||
let setLineCap: number;
|
||||
let setLineJoin: number;
|
||||
let setMiterLimit: number;
|
||||
let setDash: number;
|
||||
let setRenderingIntent: number;
|
||||
let setFlatness: number;
|
||||
let setGState: number;
|
||||
let save: number;
|
||||
let restore: number;
|
||||
let transform: number;
|
||||
let moveTo: number;
|
||||
let lineTo: number;
|
||||
let curveTo: number;
|
||||
let curveTo2: number;
|
||||
let curveTo3: number;
|
||||
let closePath: number;
|
||||
let rectangle: number;
|
||||
let stroke: number;
|
||||
let closeStroke: number;
|
||||
let fill: number;
|
||||
let eoFill: number;
|
||||
let fillStroke: number;
|
||||
let eoFillStroke: number;
|
||||
let closeFillStroke: number;
|
||||
let closeEOFillStroke: number;
|
||||
let endPath: number;
|
||||
let clip: number;
|
||||
let eoClip: number;
|
||||
let beginText: number;
|
||||
let endText: number;
|
||||
let setCharSpacing: number;
|
||||
let setWordSpacing: number;
|
||||
let setHScale: number;
|
||||
let setLeading: number;
|
||||
let setFont: number;
|
||||
let setTextRenderingMode: number;
|
||||
let setTextRise: number;
|
||||
let moveText: number;
|
||||
let setLeadingMoveText: number;
|
||||
let setTextMatrix: number;
|
||||
let nextLine: number;
|
||||
let showText: number;
|
||||
let showSpacedText: number;
|
||||
let nextLineShowText: number;
|
||||
let nextLineSetSpacingShowText: number;
|
||||
let setCharWidth: number;
|
||||
let setCharWidthAndBounds: number;
|
||||
let setStrokeColorSpace: number;
|
||||
let setFillColorSpace: number;
|
||||
let setStrokeColor: number;
|
||||
let setStrokeColorN: number;
|
||||
let setFillColor: number;
|
||||
let setFillColorN: number;
|
||||
let setStrokeGray: number;
|
||||
let setFillGray: number;
|
||||
let setStrokeRGBColor: number;
|
||||
let setFillRGBColor: number;
|
||||
let setStrokeCMYKColor: number;
|
||||
let setFillCMYKColor: number;
|
||||
let shadingFill: number;
|
||||
let beginInlineImage: number;
|
||||
let beginImageData: number;
|
||||
let endInlineImage: number;
|
||||
let paintXObject: number;
|
||||
let markPoint: number;
|
||||
let markPointProps: number;
|
||||
let beginMarkedContent: number;
|
||||
let beginMarkedContentProps: number;
|
||||
let endMarkedContent: number;
|
||||
let beginCompat: number;
|
||||
let endCompat: number;
|
||||
let paintFormXObjectBegin: number;
|
||||
let paintFormXObjectEnd: number;
|
||||
let beginGroup: number;
|
||||
let endGroup: number;
|
||||
let beginAnnotation: number;
|
||||
let endAnnotation: number;
|
||||
let paintImageMaskXObject: number;
|
||||
let paintImageMaskXObjectGroup: number;
|
||||
let paintImageXObject: number;
|
||||
let paintInlineImageXObject: number;
|
||||
let paintInlineImageXObjectGroup: number;
|
||||
let paintImageXObjectRepeat: number;
|
||||
let paintImageMaskXObjectRepeat: number;
|
||||
let paintSolidColorImageMask: number;
|
||||
let constructPath: number;
|
||||
let setStrokeTransparent: number;
|
||||
let setFillTransparent: number;
|
||||
}
|
||||
export namespace PageActionEventType {
|
||||
export let O: string;
|
||||
let C_1: string;
|
||||
export { C_1 as C };
|
||||
}
|
||||
declare const PasswordException_base: any;
|
||||
export class PasswordException extends PasswordException_base {
|
||||
[x: string]: any;
|
||||
constructor(msg: any, code: any);
|
||||
code: any;
|
||||
}
|
||||
export namespace PasswordResponses {
|
||||
let NEED_PASSWORD: number;
|
||||
let INCORRECT_PASSWORD: number;
|
||||
}
|
||||
export namespace PermissionFlag {
|
||||
let PRINT_1: number;
|
||||
export { PRINT_1 as PRINT };
|
||||
export let MODIFY_CONTENTS: number;
|
||||
export let COPY: number;
|
||||
export let MODIFY_ANNOTATIONS: number;
|
||||
export let FILL_INTERACTIVE_FORMS: number;
|
||||
export let COPY_FOR_ACCESSIBILITY: number;
|
||||
export let ASSEMBLE: number;
|
||||
export let PRINT_HIGH_QUALITY: number;
|
||||
}
|
||||
export namespace RenderingIntentFlag {
|
||||
export let ANY: number;
|
||||
export let DISPLAY: number;
|
||||
let PRINT_2: number;
|
||||
export { PRINT_2 as PRINT };
|
||||
let SAVE_1: number;
|
||||
export { SAVE_1 as SAVE };
|
||||
export let ANNOTATIONS_FORMS: number;
|
||||
export let ANNOTATIONS_STORAGE: number;
|
||||
export let ANNOTATIONS_DISABLE: number;
|
||||
export let IS_EDITING: number;
|
||||
export let OPLIST: number;
|
||||
}
|
||||
export function setVerbosityLevel(level: any): void;
|
||||
export function shadow(obj: any, prop: any, value: any, nonSerializable?: boolean): any;
|
||||
export function string32(value: any): string;
|
||||
export function stringToBytes(str: any): Uint8Array;
|
||||
export function stringToPDFString(str: any): string;
|
||||
export function stringToUTF8String(str: any): string;
|
||||
export namespace TextRenderingMode {
|
||||
export let FILL: number;
|
||||
export let STROKE: number;
|
||||
export let FILL_STROKE: number;
|
||||
let INVISIBLE_1: number;
|
||||
export { INVISIBLE_1 as INVISIBLE };
|
||||
export let FILL_ADD_TO_PATH: number;
|
||||
export let STROKE_ADD_TO_PATH: number;
|
||||
export let FILL_STROKE_ADD_TO_PATH: number;
|
||||
export let ADD_TO_PATH: number;
|
||||
export let FILL_STROKE_MASK: number;
|
||||
export let ADD_TO_PATH_FLAG: number;
|
||||
}
|
||||
export function toBase64Util(arr: any): any;
|
||||
export function toHexUtil(arr: any): any;
|
||||
declare const UnexpectedResponseException_base: any;
|
||||
export class UnexpectedResponseException extends UnexpectedResponseException_base {
|
||||
[x: string]: any;
|
||||
constructor(msg: any, status: any);
|
||||
status: any;
|
||||
}
|
||||
declare const UnknownErrorException_base: any;
|
||||
export class UnknownErrorException extends UnknownErrorException_base {
|
||||
[x: string]: any;
|
||||
constructor(msg: any, details: any);
|
||||
details: any;
|
||||
}
|
||||
export function unreachable(msg: any): void;
|
||||
export function utf8StringToString(str: any): string;
|
||||
export class Util {
|
||||
static makeHexColor(r: any, g: any, b: any): string;
|
||||
static scaleMinMax(transform: any, minMax: any): void;
|
||||
static transform(m1: any, m2: any): any[];
|
||||
static applyTransform(p: any, m: any): any[];
|
||||
static applyInverseTransform(p: any, m: any): number[];
|
||||
static getAxialAlignedBoundingBox(r: any, m: any): number[];
|
||||
static inverseTransform(m: any): number[];
|
||||
static singularValueDecompose2dScale(m: any): number[];
|
||||
static normalizeRect(rect: any): any;
|
||||
static intersect(rect1: any, rect2: any): number[] | null;
|
||||
static "__#1@#getExtremumOnCurve"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, t: any, minMax: any): void;
|
||||
static "__#1@#getExtremum"(x0: any, x1: any, x2: any, x3: any, y0: any, y1: any, y2: any, y3: any, a: any, b: any, c: any, minMax: any): void;
|
||||
static bezierBoundingBox(x0: any, y0: any, x1: any, y1: any, x2: any, y2: any, x3: any, y3: any, minMax: any): any;
|
||||
}
|
||||
export namespace VerbosityLevel {
|
||||
let ERRORS: number;
|
||||
let WARNINGS: number;
|
||||
let INFOS: number;
|
||||
}
|
||||
export function warn(msg: any): void;
|
||||
export {};
|
||||
@@ -0,0 +1,145 @@
|
||||
/**
|
||||
* @fileoverview Rule to flag bitwise identifiers
|
||||
* @author Nicholas C. Zakas
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
*
|
||||
* Set of bitwise operators.
|
||||
*
|
||||
*/
|
||||
const BITWISE_OPERATORS = [
|
||||
"^",
|
||||
"|",
|
||||
"&",
|
||||
"<<",
|
||||
">>",
|
||||
">>>",
|
||||
"^=",
|
||||
"|=",
|
||||
"&=",
|
||||
"<<=",
|
||||
">>=",
|
||||
">>>=",
|
||||
"~",
|
||||
];
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Rule Definition
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/** @type {import('../shared/types').Rule} */
|
||||
module.exports = {
|
||||
meta: {
|
||||
type: "suggestion",
|
||||
|
||||
defaultOptions: [
|
||||
{
|
||||
allow: [],
|
||||
int32Hint: false,
|
||||
},
|
||||
],
|
||||
|
||||
docs: {
|
||||
description: "Disallow bitwise operators",
|
||||
recommended: false,
|
||||
url: "https://eslint.org/docs/latest/rules/no-bitwise",
|
||||
},
|
||||
|
||||
schema: [
|
||||
{
|
||||
type: "object",
|
||||
properties: {
|
||||
allow: {
|
||||
type: "array",
|
||||
items: {
|
||||
enum: BITWISE_OPERATORS,
|
||||
},
|
||||
uniqueItems: true,
|
||||
},
|
||||
int32Hint: {
|
||||
type: "boolean",
|
||||
},
|
||||
},
|
||||
additionalProperties: false,
|
||||
},
|
||||
],
|
||||
|
||||
messages: {
|
||||
unexpected: "Unexpected use of '{{operator}}'.",
|
||||
},
|
||||
},
|
||||
|
||||
create(context) {
|
||||
const [{ allow: allowed, int32Hint }] = context.options;
|
||||
|
||||
/**
|
||||
* Reports an unexpected use of a bitwise operator.
|
||||
* @param {ASTNode} node Node which contains the bitwise operator.
|
||||
* @returns {void}
|
||||
*/
|
||||
function report(node) {
|
||||
context.report({
|
||||
node,
|
||||
messageId: "unexpected",
|
||||
data: { operator: node.operator },
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given node has a bitwise operator.
|
||||
* @param {ASTNode} node The node to check.
|
||||
* @returns {boolean} Whether or not the node has a bitwise operator.
|
||||
*/
|
||||
function hasBitwiseOperator(node) {
|
||||
return BITWISE_OPERATORS.includes(node.operator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`.
|
||||
* @param {ASTNode} node The node to check.
|
||||
* @returns {boolean} Whether or not the node has a bitwise operator.
|
||||
*/
|
||||
function allowedOperator(node) {
|
||||
return allowed.includes(node.operator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the given bitwise operator is used for integer typecasting, i.e. "|0"
|
||||
* @param {ASTNode} node The node to check.
|
||||
* @returns {boolean} whether the node is used in integer typecasting.
|
||||
*/
|
||||
function isInt32Hint(node) {
|
||||
return (
|
||||
int32Hint &&
|
||||
node.operator === "|" &&
|
||||
node.right &&
|
||||
node.right.type === "Literal" &&
|
||||
node.right.value === 0
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Report if the given node contains a bitwise operator.
|
||||
* @param {ASTNode} node The node to check.
|
||||
* @returns {void}
|
||||
*/
|
||||
function checkNodeForBitwiseOperator(node) {
|
||||
if (
|
||||
hasBitwiseOperator(node) &&
|
||||
!allowedOperator(node) &&
|
||||
!isInt32Hint(node)
|
||||
) {
|
||||
report(node);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
AssignmentExpression: checkNodeForBitwiseOperator,
|
||||
BinaryExpression: checkNodeForBitwiseOperator,
|
||||
UnaryExpression: checkNodeForBitwiseOperator,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"set-array.mjs","sources":["../src/set-array.ts"],"sourcesContent":["type Key = string | number | symbol;\n\n/**\n * SetArray acts like a `Set` (allowing only one occurrence of a string `key`), but provides the\n * index of the `key` in the backing array.\n *\n * This is designed to allow synchronizing a second array with the contents of the backing array,\n * like how in a sourcemap `sourcesContent[i]` is the source content associated with `source[i]`,\n * and there are never duplicates.\n */\nexport class SetArray<T extends Key = Key> {\n private declare _indexes: Record<T, number | undefined>;\n declare array: readonly T[];\n\n constructor() {\n this._indexes = { __proto__: null } as any;\n this.array = [];\n }\n}\n\ninterface PublicSet<T extends Key> {\n array: T[];\n _indexes: SetArray<T>['_indexes'];\n}\n\n/**\n * Typescript doesn't allow friend access to private fields, so this just casts the set into a type\n * with public access modifiers.\n */\nfunction cast<T extends Key>(set: SetArray<T>): PublicSet<T> {\n return set as any;\n}\n\n/**\n * Gets the index associated with `key` in the backing array, if it is already present.\n */\nexport function get<T extends Key>(setarr: SetArray<T>, key: T): number | undefined {\n return cast(setarr)._indexes[key];\n}\n\n/**\n * Puts `key` into the backing array, if it is not already present. Returns\n * the index of the `key` in the backing array.\n */\nexport function put<T extends Key>(setarr: SetArray<T>, key: T): number {\n // The key may or may not be present. If it is present, it's a number.\n const index = get(setarr, key);\n if (index !== undefined) return index;\n\n const { array, _indexes: indexes } = cast(setarr);\n\n const length = array.push(key);\n return (indexes[key] = length - 1);\n}\n\n/**\n * Pops the last added item out of the SetArray.\n */\nexport function pop<T extends Key>(setarr: SetArray<T>): void {\n const { array, _indexes: indexes } = cast(setarr);\n if (array.length === 0) return;\n\n const last = array.pop()!;\n indexes[last] = undefined;\n}\n\n/**\n * Removes the key, if it exists in the set.\n */\nexport function remove<T extends Key>(setarr: SetArray<T>, key: T): void {\n const index = get(setarr, key);\n if (index === undefined) return;\n\n const { array, _indexes: indexes } = cast(setarr);\n for (let i = index + 1; i < array.length; i++) {\n const k = array[i];\n array[i - 1] = k;\n indexes[k]!--;\n }\n indexes[key] = undefined;\n array.pop();\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;MAQa,QAAQ;IAInB;QACE,IAAI,CAAC,QAAQ,GAAG,EAAE,SAAS,EAAE,IAAI,EAAS,CAAC;QAC3C,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;KACjB;CACF;AAOD;;;;AAIA,SAAS,IAAI,CAAgB,GAAgB;IAC3C,OAAO,GAAU,CAAC;AACpB,CAAC;AAED;;;SAGgB,GAAG,CAAgB,MAAmB,EAAE,GAAM;IAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC;AAED;;;;SAIgB,GAAG,CAAgB,MAAmB,EAAE,GAAM;;IAE5D,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IAEtC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAElD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/B,QAAQ,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE;AACrC,CAAC;AAED;;;SAGgB,GAAG,CAAgB,MAAmB;IACpD,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAClD,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAE/B,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,EAAG,CAAC;IAC1B,OAAO,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;AAC5B,CAAC;AAED;;;SAGgB,MAAM,CAAgB,MAAmB,EAAE,GAAM;IAC/D,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO;IAEhC,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC;IAClD,KAAK,IAAI,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC7C,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;QACnB,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;QACjB,OAAO,CAAC,CAAC,CAAE,EAAE,CAAC;KACf;IACD,OAAO,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IACzB,KAAK,CAAC,GAAG,EAAE,CAAC;AACd;;;;"}
|
||||
@@ -0,0 +1,3 @@
|
||||
const compare = require('./compare')
|
||||
const gt = (a, b, loose) => compare(a, b, loose) > 0
|
||||
module.exports = gt
|
||||
Reference in New Issue
Block a user