
diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/4-6/down.html" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/4-6/down.html" new file mode 100644 index 0000000000000000000000000000000000000000..014c5f9151e12a99b52027482a00e1fd51e66279 --- /dev/null +++ "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/4-6/down.html" @@ -0,0 +1,38 @@ + + +
+ + +A JavaScript library for arbitrary-precision arithmetic.
- - -- See the README on GitHub for a - quick-start introduction. -
-
- In all examples below, var
and semicolons are not shown, and if a commented-out
- value is in quotes it means toString
has been called on the preceding expression.
-
BigNumber(n [, base]) ⇒ BigNumber
-
- n
: number|string|BigNumber
- base
: number: integer, 2
to 36
inclusive. (See
- ALPHABET
to extend this range).
-
- Returns a new instance of a BigNumber object with value n
, where n
- is a numeric value in the specified base
, or base 10
if
- base
is omitted or is null
or undefined
.
-
-x = new BigNumber(123.4567) // '123.4567' -// 'new' is optional -y = BigNumber(x) // '123.4567'-
- If n
is a base 10
value it can be in normal (fixed-point) or
- exponential notation. Values in other bases must be in normal notation. Values in any base can
- have fraction digits, i.e. digits after the decimal point.
-
-new BigNumber(43210) // '43210' -new BigNumber('4.321e+4') // '43210' -new BigNumber('-735.0918e-430') // '-7.350918e-428' -new BigNumber('123412421.234324', 5) // '607236.557696'-
- Signed 0
, signed Infinity
and NaN
are supported.
-
-new BigNumber('-Infinity') // '-Infinity' -new BigNumber(NaN) // 'NaN' -new BigNumber(-0) // '0' -new BigNumber('.5') // '0.5' -new BigNumber('+2') // '2'-
- String values in hexadecimal literal form, e.g. '0xff'
, are valid, as are
- string values with the octal and binary prefixs '0o'
and '0b'
.
- String values in octal literal form without the prefix will be interpreted as
- decimals, e.g. '011'
is interpreted as 11, not 9.
-
-new BigNumber(-10110100.1, 2) // '-180.5' -new BigNumber('-0b10110100.1') // '-180.5' -new BigNumber('ff.8', 16) // '255.5' -new BigNumber('0xff.8') // '255.5'-
- If a base is specified, n
is rounded according to the current
- DECIMAL_PLACES
and
- ROUNDING_MODE
settings. This includes base
- 10
so don't include a base
parameter for decimal values unless
- this behaviour is wanted.
-
BigNumber.config({ DECIMAL_PLACES: 5 }) -new BigNumber(1.23456789) // '1.23456789' -new BigNumber(1.23456789, 10) // '1.23457'-
An error is thrown if base
is invalid. See Errors.
- There is no limit to the number of digits of a value of type string (other than
- that of JavaScript's maximum array size). See RANGE
to set
- the maximum and minimum possible exponent value of a BigNumber.
-
-new BigNumber('5032485723458348569331745.33434346346912144534543') -new BigNumber('4.321e10000000')-
BigNumber NaN
is returned if n
is invalid
- (unless BigNumber.DEBUG
is true
, see below).
-new BigNumber('.1*') // 'NaN' -new BigNumber('blurgh') // 'NaN' -new BigNumber(9, 2) // 'NaN'-
- To aid in debugging, if BigNumber.DEBUG
is true
then an error will
- be thrown on an invalid n
. An error will also be thrown if n
is of
- type number with more than 15
significant digits, as calling
- toString
or valueOf
on
- these numbers may not result in the intended value.
-
-console.log(823456789123456.3) // 823456789123456.2 -new BigNumber(823456789123456.3) // '823456789123456.2' -BigNumber.DEBUG = true -// '[BigNumber Error] Number primitive has more than 15 significant digits' -new BigNumber(823456789123456.3) -// '[BigNumber Error] Not a base 2 number' -new BigNumber(9, 2)-
- A BigNumber can also be created from an object literal.
- Use isBigNumber
to check that it is well-formed.
-
new BigNumber({ s: 1, e: 2, c: [ 777, 12300000000000 ], _isBigNumber: true }) // '777.123'- - - - -
The static methods of a BigNumber constructor.
- - - - -.clone([object]) ⇒ BigNumber constructor
- object
: object
- Returns a new independent BigNumber constructor with configuration as described by
- object
(see config
), or with the default
- configuration if object
is null
or undefined
.
-
- Throws if object
is not an object. See Errors.
-
BigNumber.config({ DECIMAL_PLACES: 5 }) -BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) - -x = new BigNumber(1) -y = new BN(1) - -x.div(3) // 0.33333 -y.div(3) // 0.333333333 - -// BN = BigNumber.clone({ DECIMAL_PLACES: 9 }) is equivalent to: -BN = BigNumber.clone() -BN.config({ DECIMAL_PLACES: 9 })- - - -
set([object]) ⇒ object
- object
: object: an object that contains some or all of the following
- properties.
-
Configures the settings for this particular BigNumber constructor.
- -DECIMAL_PLACES
0
to 1e+9
inclusive20
- BigNumber.config({ DECIMAL_PLACES: 5 }) -BigNumber.set({ DECIMAL_PLACES: 5 }) // equivalent-
ROUNDING_MODE
0
to 8
inclusive4
(ROUND_HALF_UP
)
- decimalPlaces
,
- precision
,
- toExponential
,
- toFixed
,
- toFormat
and
- toPrecision
.
- BigNumber.config({ ROUNDING_MODE: 0 }) -BigNumber.set({ ROUNDING_MODE: BigNumber.ROUND_UP }) // equivalent-
EXPONENTIAL_AT
0
to 1e+9
inclusive, or
- -1e+9
to 0
inclusive, integer
- 0
to 1e+9
inclusive ][-7, 20]
- toString
returns exponential notation.
- [-7, 20]
.
- BigNumber.config({ EXPONENTIAL_AT: 2 }) -new BigNumber(12.3) // '12.3' e is only 1 -new BigNumber(123) // '1.23e+2' -new BigNumber(0.123) // '0.123' e is only -1 -new BigNumber(0.0123) // '1.23e-2' - -BigNumber.config({ EXPONENTIAL_AT: [-7, 20] }) -new BigNumber(123456789) // '123456789' e is only 8 -new BigNumber(0.000000123) // '1.23e-7' - -// Almost never return exponential notation: -BigNumber.config({ EXPONENTIAL_AT: 1e+9 }) - -// Always return exponential notation: -BigNumber.config({ EXPONENTIAL_AT: 0 })-
EXPONENTIAL_AT
, the toFixed
method
- will always return a value in normal notation and the toExponential
method
- will always return a value in exponential form.
- toString
with a base argument, e.g. toString(10)
, will
- also always return normal notation.
- RANGE
1
to 1e+9
inclusive, or
- -1e+9
to -1
inclusive, integer
- 1
to 1e+9
inclusive ][-1e+9, 1e+9]
- Infinity
and underflow to
- zero occurs.
- Infinity
and those with a
- negative exponent of greater magnitude become zero.
- Infinity
, use [-324, 308]
.
- BigNumber.config({ RANGE: 500 }) -BigNumber.config().RANGE // [ -500, 500 ] -new BigNumber('9.999e499') // '9.999e+499' -new BigNumber('1e500') // 'Infinity' -new BigNumber('1e-499') // '1e-499' -new BigNumber('1e-500') // '0' - -BigNumber.config({ RANGE: [-3, 4] }) -new BigNumber(99999) // '99999' e is only 4 -new BigNumber(100000) // 'Infinity' e is 5 -new BigNumber(0.001) // '0.01' e is only -3 -new BigNumber(0.0001) // '0' e is -4-
9.999...e+1000000000
.1e-1000000000
.
- CRYPTO
true
or false
.false
- CRYPTO
is set to true
then the
- random
method will generate random digits using
- crypto.getRandomValues
in browsers that support it, or
- crypto.randomBytes
if using Node.js.
- CRYPTO
to true
will fail and an exception will be thrown.
- CRYPTO
is false
then the source of randomness used will be
- Math.random
(which is assumed to generate at least 30
bits of
- randomness).
- random
.-// Node.js -global.crypto = require('crypto') - -BigNumber.config({ CRYPTO: true }) -BigNumber.config().CRYPTO // true -BigNumber.random() // 0.54340758610486147524-
MODULO_MODE
0
to 9
inclusive1
(ROUND_DOWN
)
- a mod n
.q = a / n
, is calculated according to the
- ROUNDING_MODE
that corresponds to the chosen
- MODULO_MODE
.
- r
, is calculated as: r = a - n * q
.Property | Value | Description |
---|---|---|
ROUND_UP | 0 | -- The remainder is positive if the dividend is negative, otherwise it is negative. - | -
ROUND_DOWN | 1 | -
- The remainder has the same sign as the dividend. - This uses 'truncating division' and matches the behaviour of JavaScript's - remainder operator % .
- |
-
ROUND_FLOOR | 3 | -
- The remainder has the same sign as the divisor. - This matches Python's % operator.
- |
-
ROUND_HALF_EVEN | 6 | -The IEEE 754 remainder function. | -
EUCLID | 9 | -
- The remainder is always positive. Euclidian division: - q = sign(n) * floor(a / abs(n))
- |
-
modulo
.BigNumber.config({ MODULO_MODE: BigNumber.EUCLID }) -BigNumber.config({ MODULO_MODE: 9 }) // equivalent-
POW_PRECISION
0
to 1e+9
inclusive.0
- 0
, the number of significant digits will not be limited.exponentiatedBy
.BigNumber.config({ POW_PRECISION: 100 })
FORMAT
FORMAT
object configures the format of the string returned by the
- toFormat
method.
- FORMAT
object that are
- recognised, and their default values.
- FORMAT
object will not be checked for validity. The existing
- FORMAT
object will simply be replaced by the object that is passed in.
- The object can include any number of the properties shown below.
- toFormat
for examples of usage.-BigNumber.config({ - FORMAT: { - // string to prepend - prefix: '', - // decimal separator - decimalSeparator: '.', - // grouping separator of the integer part - groupSeparator: ',', - // primary grouping size of the integer part - groupSize: 3, - // secondary grouping size of the integer part - secondaryGroupSize: 0, - // grouping separator of the fraction part - fractionGroupSeparator: ' ', - // grouping size of the fraction part - fractionGroupSize: 0, - // string to append - suffix: '' - } -});-
ALPHABET
'0123456789abcdefghijklmnopqrstuvwxyz'
- BigNumber
constructor or
- toString
.
- '+'
and '-'
, or the decimal separator '.'
.
- // duodecimal (base 12) -BigNumber.config({ ALPHABET: '0123456789TE' }) -x = new BigNumber('T', 12) -x.toString() // '10' -x.toString(12) // 'T'-
Returns an object with the above properties and their current values.
-
- Throws if object
is not an object, or if an invalid value is assigned to
- one or more of the above properties. See Errors.
-
-BigNumber.config({ - DECIMAL_PLACES: 40, - ROUNDING_MODE: BigNumber.ROUND_HALF_CEIL, - EXPONENTIAL_AT: [-10, 20], - RANGE: [-500, 500], - CRYPTO: true, - MODULO_MODE: BigNumber.ROUND_FLOOR, - POW_PRECISION: 80, - FORMAT: { - groupSize: 3, - groupSeparator: ' ', - decimalSeparator: ',' - }, - ALPHABET: '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_' -}); - -obj = BigNumber.config(); -obj.DECIMAL_PLACES // 40 -obj.RANGE // [-500, 500]- - - -
.isBigNumber(value) ⇒ boolean
- value
: any
- Returns true
if value
is a BigNumber instance, otherwise returns
- false
.
-
x = 42 -y = new BigNumber(x) - -BigNumber.isBigNumber(x) // false -y instanceof BigNumber // true -BigNumber.isBigNumber(y) // true - -BN = BigNumber.clone(); -z = new BN(x) -z instanceof BigNumber // false -BigNumber.isBigNumber(z) // true-
- If value
is a BigNumber instance and BigNumber.DEBUG
is true
,
- then this method will also check if value
is well-formed, and throw if it is not.
- See Errors.
-
- The check can be useful if creating a BigNumber from an object literal. - See BigNumber. -
--x = new BigNumber(10) - -// Change x.c to an illegitimate value. -x.c = NaN - -BigNumber.DEBUG = false - -// No error. -BigNumber.isBigNumber(x) // true - -BigNumber.DEBUG = true - -// Error. -BigNumber.isBigNumber(x) // '[BigNumber Error] Invalid BigNumber'- - - -
.max(n...) ⇒ BigNumber
- n
: number|string|BigNumber
- See BigNumber
for further parameter details.
-
- Returns a BigNumber whose value is the maximum of the arguments. -
-The return value is always exact and unrounded.
-x = new BigNumber('3257869345.0378653') -BigNumber.maximum(4e9, x, '123456789.9') // '4000000000' - -arr = [12, '13', new BigNumber(14)] -BigNumber.max.apply(null, arr) // '14'- - - -
.min(n...) ⇒ BigNumber
- n
: number|string|BigNumber
- See BigNumber
for further parameter details.
-
- Returns a BigNumber whose value is the minimum of the arguments. -
-The return value is always exact and unrounded.
-x = new BigNumber('3257869345.0378653') -BigNumber.minimum(4e9, x, '123456789.9') // '123456789.9' - -arr = [2, new BigNumber(-14), '-15.9999', -12] -BigNumber.min.apply(null, arr) // '-15.9999'- - - -
.random([dp]) ⇒ BigNumber
- dp
: number: integer, 0
to 1e+9
inclusive
- Returns a new BigNumber with a pseudo-random value equal to or greater than 0
and
- less than 1
.
-
- The return value will have dp
decimal places (or less if trailing zeros are
- produced).
- If dp
is omitted then the number of decimal places will default to the current
- DECIMAL_PLACES
setting.
-
- Depending on the value of this BigNumber constructor's
- CRYPTO
setting and the support for the
- crypto
object in the host environment, the random digits of the return value are
- generated by either Math.random
(fastest), crypto.getRandomValues
- (Web Cryptography API in recent browsers) or crypto.randomBytes
(Node.js).
-
- To be able to set CRYPTO
to true
when using
- Node.js, the crypto
object must be available globally:
-
global.crypto = require('crypto')-
- If CRYPTO
is true
, i.e. one of the
- crypto
methods is to be used, the value of a returned BigNumber should be
- cryptographically-secure and statistically indistinguishable from a random value.
-
- Throws if dp
is invalid. See Errors.
-
BigNumber.config({ DECIMAL_PLACES: 10 }) -BigNumber.random() // '0.4117936847' -BigNumber.random(20) // '0.78193327636914089009'- - - -
.sum(n...) ⇒ BigNumber
- n
: number|string|BigNumber
- See BigNumber
for further parameter details.
-
Returns a BigNumber whose value is the sum of the arguments.
-The return value is always exact and unrounded.
-x = new BigNumber('3257869345.0378653') -BigNumber.sum(4e9, x, '123456789.9') // '7381326134.9378653' - -arr = [2, new BigNumber(14), '15.9999', 12] -BigNumber.sum.apply(null, arr) // '43.9999'- - - -
- The library's enumerated rounding modes are stored as properties of the constructor.
- (They are not referenced internally by the library itself.)
-
- Rounding modes 0
to 6
(inclusive) are the same as those of Java's
- BigDecimal class.
-
Property | -Value | -Description | -
---|---|---|
ROUND_UP | -0 | -Rounds away from zero | -
ROUND_DOWN | -1 | -Rounds towards zero | -
ROUND_CEIL | -2 | -Rounds towards Infinity |
-
ROUND_FLOOR | -3 | -Rounds towards -Infinity |
-
ROUND_HALF_UP | -4 | -
- Rounds towards nearest neighbour. - If equidistant, rounds away from zero - |
-
ROUND_HALF_DOWN | -5 | -
- Rounds towards nearest neighbour. - If equidistant, rounds towards zero - |
-
ROUND_HALF_EVEN | -6 | -
- Rounds towards nearest neighbour. - If equidistant, rounds towards even neighbour - |
-
ROUND_HALF_CEIL | -7 | -
- Rounds towards nearest neighbour. - If equidistant, rounds towards Infinity
- |
-
ROUND_HALF_FLOOR | -8 | -
- Rounds towards nearest neighbour. - If equidistant, rounds towards -Infinity
- |
-
-BigNumber.config({ ROUNDING_MODE: BigNumber.ROUND_CEIL }) -BigNumber.config({ ROUNDING_MODE: 2 }) // equivalent- -
undefined|false|true
-
- If BigNumber.DEBUG
is set true
then an error will be thrown
- if this BigNumber constructor receives an invalid value, such as
- a value of type number with more than 15
significant digits.
- See BigNumber.
-
- An error will also be thrown if the isBigNumber
- method receives a BigNumber that is not well-formed.
- See isBigNumber
.
-
BigNumber.DEBUG = true- - -
The methods inherited by a BigNumber instance from its constructor's prototype object.
-A BigNumber is immutable in the sense that it is not changed by its methods.
-
- The treatment of ±0
, ±Infinity
and NaN
is
- consistent with how JavaScript treats these values.
-
Many method names have a shorter alias.
- - - -.abs() ⇒ BigNumber
- Returns a BigNumber whose value is the absolute value, i.e. the magnitude, of the value of - this BigNumber. -
-The return value is always exact and unrounded.
--x = new BigNumber(-0.8) -y = x.absoluteValue() // '0.8' -z = y.abs() // '0.8'- - - -
.comparedTo(n [, base]) ⇒ number
-
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
Returns | |
---|---|
1 |
- If the value of this BigNumber is greater than the value of n |
-
-1 |
- If the value of this BigNumber is less than the value of n |
-
0 |
- If this BigNumber and n have the same value |
-
null |
- If the value of either this BigNumber or n is NaN |
-
-x = new BigNumber(Infinity) -y = new BigNumber(5) -x.comparedTo(y) // 1 -x.comparedTo(x.minus(1)) // 0 -y.comparedTo(NaN) // null -y.comparedTo('110', 2) // -1- - - -
.dp([dp [, rm]]) ⇒ BigNumber|number
-
- dp
: number: integer, 0
to 1e+9
inclusive
- rm
: number: integer, 0
to 8
inclusive
-
- If dp
is a number, returns a BigNumber whose value is the value of this BigNumber
- rounded by rounding mode rm
to a maximum of dp
decimal places.
-
- If dp
is omitted, or is null
or undefined
, the return
- value is the number of decimal places of the value of this BigNumber, or null
if
- the value of this BigNumber is ±Infinity
or NaN
.
-
- If rm
is omitted, or is null
or undefined
,
- ROUNDING_MODE
is used.
-
- Throws if dp
or rm
is invalid. See Errors.
-
-x = new BigNumber(1234.56) -x.decimalPlaces(1) // '1234.6' -x.dp() // 2 -x.decimalPlaces(2) // '1234.56' -x.dp(10) // '1234.56' -x.decimalPlaces(0, 1) // '1234' -x.dp(0, 6) // '1235' -x.decimalPlaces(1, 1) // '1234.5' -x.dp(1, BigNumber.ROUND_HALF_EVEN) // '1234.6' -x // '1234.56' -y = new BigNumber('9.9e-101') -y.dp() // 102- - - -
.div(n [, base]) ⇒ BigNumber
-
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
- Returns a BigNumber whose value is the value of this BigNumber divided by
- n
, rounded according to the current
- DECIMAL_PLACES
and
- ROUNDING_MODE
settings.
-
-x = new BigNumber(355) -y = new BigNumber(113) -x.dividedBy(y) // '3.14159292035398230088' -x.div(5) // '71' -x.div(47, 16) // '5'- - - -
.idiv(n [, base]) ⇒
- BigNumber
-
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
- Returns a BigNumber whose value is the integer part of dividing the value of this BigNumber by
- n
.
-
-x = new BigNumber(5) -y = new BigNumber(3) -x.dividedToIntegerBy(y) // '1' -x.idiv(0.7) // '7' -x.idiv('0.f', 16) // '5'- - - -
.pow(n [, m]) ⇒ BigNumber
-
- n
: number|string|BigNumber: integer
- m
: number|string|BigNumber
-
- Returns a BigNumber whose value is the value of this BigNumber exponentiated by
- n
, i.e. raised to the power n
, and optionally modulo a modulus
- m
.
-
- Throws if n
is not an integer. See Errors.
-
- If n
is negative the result is rounded according to the current
- DECIMAL_PLACES
and
- ROUNDING_MODE
settings.
-
- As the number of digits of the result of the power operation can grow so large so quickly,
- e.g. 123.45610000 has over 50000
digits, the number of significant
- digits calculated is limited to the value of the
- POW_PRECISION
setting (unless a modulus
- m
is specified).
-
- By default POW_PRECISION
is set to 0
.
- This means that an unlimited number of significant digits will be calculated, and that the
- method's performance will decrease dramatically for larger exponents.
-
- If m
is specified and the value of m
, n
and this
- BigNumber are integers, and n
is positive, then a fast modular exponentiation
- algorithm is used, otherwise the operation will be performed as
- x.exponentiatedBy(n).modulo(m)
with a
- POW_PRECISION
of 0
.
-
-Math.pow(0.7, 2) // 0.48999999999999994 -x = new BigNumber(0.7) -x.exponentiatedBy(2) // '0.49' -BigNumber(3).pow(-2) // '0.11111111111111111111'- - - -
.integerValue([rm]) ⇒ BigNumber
-
- rm
: number: integer, 0
to 8
inclusive
-
- Returns a BigNumber whose value is the value of this BigNumber rounded to an integer using
- rounding mode rm
.
-
- If rm
is omitted, or is null
or undefined
,
- ROUNDING_MODE
is used.
-
- Throws if rm
is invalid. See Errors.
-
-x = new BigNumber(123.456) -x.integerValue() // '123' -x.integerValue(BigNumber.ROUND_CEIL) // '124' -y = new BigNumber(-12.7) -y.integerValue() // '-13' -y.integerValue(BigNumber.ROUND_DOWN) // '-12'-
- The following is an example of how to add a prototype method that emulates JavaScript's
- Math.round
function. Math.ceil
, Math.floor
and
- Math.trunc
can be emulated in the same way with
- BigNumber.ROUND_CEIL
, BigNumber.ROUND_FLOOR
and
- BigNumber.ROUND_DOWN
respectively.
-
-BigNumber.prototype.round = function (n) { - return n.integerValue(BigNumber.ROUND_HALF_CEIL); -}; -x.round() // '123'- - - -
.eq(n [, base]) ⇒ boolean
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
- Returns true
if the value of this BigNumber is equal to the value of
- n
, otherwise returns false
.
- As with JavaScript, NaN
does not equal NaN
.
-
Note: This method uses the comparedTo
method internally.
-0 === 1e-324 // true -x = new BigNumber(0) -x.isEqualTo('1e-324') // false -BigNumber(-0).eq(x) // true ( -0 === 0 ) -BigNumber(255).eq('ff', 16) // true - -y = new BigNumber(NaN) -y.isEqualTo(NaN) // false- - - -
.isFinite() ⇒ boolean
- Returns true
if the value of this BigNumber is a finite number, otherwise
- returns false
.
-
- The only possible non-finite values of a BigNumber are NaN
, Infinity
- and -Infinity
.
-
-x = new BigNumber(1) -x.isFinite() // true -y = new BigNumber(Infinity) -y.isFinite() // false-
- Note: The native method isFinite()
can be used if
- n <= Number.MAX_VALUE
.
-
.gt(n [, base]) ⇒ boolean
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
- Returns true
if the value of this BigNumber is greater than the value of
- n
, otherwise returns false
.
-
Note: This method uses the comparedTo
method internally.
-0.1 > (0.3 - 0.2) // true -x = new BigNumber(0.1) -x.isGreaterThan(BigNumber(0.3).minus(0.2)) // false -BigNumber(0).gt(x) // false -BigNumber(11, 3).gt(11.1, 2) // true- - - -
.gte(n [, base]) ⇒ boolean
-
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
- Returns true
if the value of this BigNumber is greater than or equal to the value
- of n
, otherwise returns false
.
-
Note: This method uses the comparedTo
method internally.
-(0.3 - 0.2) >= 0.1 // false -x = new BigNumber(0.3).minus(0.2) -x.isGreaterThanOrEqualTo(0.1) // true -BigNumber(1).gte(x) // true -BigNumber(10, 18).gte('i', 36) // true- - - -
.isInteger() ⇒ boolean
- Returns true
if the value of this BigNumber is an integer, otherwise returns
- false
.
-
-x = new BigNumber(1) -x.isInteger() // true -y = new BigNumber(123.456) -y.isInteger() // false- - - -
.lt(n [, base]) ⇒ boolean
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
- Returns true
if the value of this BigNumber is less than the value of
- n
, otherwise returns false
.
-
Note: This method uses the comparedTo
method internally.
-(0.3 - 0.2) < 0.1 // true -x = new BigNumber(0.3).minus(0.2) -x.isLessThan(0.1) // false -BigNumber(0).lt(x) // true -BigNumber(11.1, 2).lt(11, 3) // true- - - -
.lte(n [, base]) ⇒ boolean
-
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
- Returns true
if the value of this BigNumber is less than or equal to the value of
- n
, otherwise returns false
.
-
Note: This method uses the comparedTo
method internally.
-0.1 <= (0.3 - 0.2) // false -x = new BigNumber(0.1) -x.isLessThanOrEqualTo(BigNumber(0.3).minus(0.2)) // true -BigNumber(-1).lte(x) // true -BigNumber(10, 18).lte('i', 36) // true- - - -
.isNaN() ⇒ boolean
- Returns true
if the value of this BigNumber is NaN
, otherwise
- returns false
.
-
-x = new BigNumber(NaN) -x.isNaN() // true -y = new BigNumber('Infinity') -y.isNaN() // false-
Note: The native method isNaN()
can also be used.
.isNegative() ⇒ boolean
- Returns true
if the sign of this BigNumber is negative, otherwise returns
- false
.
-
-x = new BigNumber(-0) -x.isNegative() // true -y = new BigNumber(2) -y.isNegative() // false-
Note: n < 0
can be used if n <= -Number.MIN_VALUE
.
.isPositive() ⇒ boolean
- Returns true
if the sign of this BigNumber is positive, otherwise returns
- false
.
-
-x = new BigNumber(-0) -x.isPositive() // false -y = new BigNumber(2) -y.isPositive() // true- - - -
.isZero() ⇒ boolean
- Returns true
if the value of this BigNumber is zero or minus zero, otherwise
- returns false
.
-
-x = new BigNumber(-0) -x.isZero() && x.isNegative() // true -y = new BigNumber(Infinity) -y.isZero() // false-
Note: n == 0
can be used if n >= Number.MIN_VALUE
.
.minus(n [, base]) ⇒ BigNumber
-
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
Returns a BigNumber whose value is the value of this BigNumber minus n
.
The return value is always exact and unrounded.
--0.3 - 0.1 // 0.19999999999999998 -x = new BigNumber(0.3) -x.minus(0.1) // '0.2' -x.minus(0.6, 20) // '0'- - - -
.mod(n [, base]) ⇒ BigNumber
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
- Returns a BigNumber whose value is the value of this BigNumber modulo n
, i.e.
- the integer remainder of dividing this BigNumber by n
.
-
- The value returned, and in particular its sign, is dependent on the value of the
- MODULO_MODE
setting of this BigNumber constructor.
- If it is 1
(default value), the result will have the same sign as this BigNumber,
- and it will match that of Javascript's %
operator (within the limits of double
- precision) and BigDecimal's remainder
method.
-
The return value is always exact and unrounded.
-
- See MODULO_MODE
for a description of the other
- modulo modes.
-
-1 % 0.9 // 0.09999999999999998 -x = new BigNumber(1) -x.modulo(0.9) // '0.1' -y = new BigNumber(33) -y.mod('a', 33) // '3'- - - -
.times(n [, base]) ⇒ BigNumber
-
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
- Returns a BigNumber whose value is the value of this BigNumber multiplied by n
.
-
The return value is always exact and unrounded.
--0.6 * 3 // 1.7999999999999998 -x = new BigNumber(0.6) -y = x.multipliedBy(3) // '1.8' -BigNumber('7e+500').times(y) // '1.26e+501' -x.multipliedBy('-a', 16) // '-6'- - - -
.negated() ⇒ BigNumber
- Returns a BigNumber whose value is the value of this BigNumber negated, i.e. multiplied by
- -1
.
-
-x = new BigNumber(1.8) -x.negated() // '-1.8' -y = new BigNumber(-1.3) -y.negated() // '1.3'- - - -
.plus(n [, base]) ⇒ BigNumber
- n
: number|string|BigNumber
- base
: number
- See BigNumber for further parameter details.
-
Returns a BigNumber whose value is the value of this BigNumber plus n
.
The return value is always exact and unrounded.
--0.1 + 0.2 // 0.30000000000000004 -x = new BigNumber(0.1) -y = x.plus(0.2) // '0.3' -BigNumber(0.7).plus(x).plus(y) // '1' -x.plus('0.1', 8) // '0.225'- - - -
.sd([d [, rm]]) ⇒ BigNumber|number
-
- d
: number|boolean: integer, 1
to 1e+9
- inclusive, or true
or false
- rm
: number: integer, 0
to 8
inclusive.
-
- If d
is a number, returns a BigNumber whose value is the value of this BigNumber
- rounded to a precision of d
significant digits using rounding mode
- rm
.
-
- If d
is omitted or is null
or undefined
, the return
- value is the number of significant digits of the value of this BigNumber, or null
- if the value of this BigNumber is ±Infinity
or NaN
.
- If d
is true
then any trailing zeros of the integer
- part of a number are counted as significant digits, otherwise they are not.
-
- If rm
is omitted or is null
or undefined
,
- ROUNDING_MODE
will be used.
-
- Throws if d
or rm
is invalid. See Errors.
-
-x = new BigNumber(9876.54321) -x.precision(6) // '9876.54' -x.sd() // 9 -x.precision(6, BigNumber.ROUND_UP) // '9876.55' -x.sd(2) // '9900' -x.precision(2, 1) // '9800' -x // '9876.54321' -y = new BigNumber(987000) -y.precision() // 3 -y.sd(true) // 6- - - -
.shiftedBy(n) ⇒ BigNumber
- n
: number: integer,
- -9007199254740991
to 9007199254740991
inclusive
-
- Returns a BigNumber whose value is the value of this BigNumber shifted by n
- places.
-
- The shift is of the decimal point, i.e. of powers of ten, and is to the left if n
- is negative or to the right if n
is positive.
-
The return value is always exact and unrounded.
-
- Throws if n
is invalid. See Errors.
-
-x = new BigNumber(1.23) -x.shiftedBy(3) // '1230' -x.shiftedBy(-3) // '0.00123'- - - -
.sqrt() ⇒ BigNumber
- Returns a BigNumber whose value is the square root of the value of this BigNumber,
- rounded according to the current
- DECIMAL_PLACES
and
- ROUNDING_MODE
settings.
-
- The return value will be correctly rounded, i.e. rounded as if the result was first calculated - to an infinite number of correct digits before rounding. -
--x = new BigNumber(16) -x.squareRoot() // '4' -y = new BigNumber(3) -y.sqrt() // '1.73205080756887729353'- - - -
.toExponential([dp [, rm]]) ⇒ string
-
- dp
: number: integer, 0
to 1e+9
inclusive
- rm
: number: integer, 0
to 8
inclusive
-
- Returns a string representing the value of this BigNumber in exponential notation rounded
- using rounding mode rm
to dp
decimal places, i.e with one digit
- before the decimal point and dp
digits after it.
-
- If the value of this BigNumber in exponential notation has fewer than dp
fraction
- digits, the return value will be appended with zeros accordingly.
-
- If dp
is omitted, or is null
or undefined
, the number
- of digits after the decimal point defaults to the minimum number of digits necessary to
- represent the value exactly.
- If rm
is omitted or is null
or undefined
,
- ROUNDING_MODE
is used.
-
- Throws if dp
or rm
is invalid. See Errors.
-
-x = 45.6 -y = new BigNumber(x) -x.toExponential() // '4.56e+1' -y.toExponential() // '4.56e+1' -x.toExponential(0) // '5e+1' -y.toExponential(0) // '5e+1' -x.toExponential(1) // '4.6e+1' -y.toExponential(1) // '4.6e+1' -y.toExponential(1, 1) // '4.5e+1' (ROUND_DOWN) -x.toExponential(3) // '4.560e+1' -y.toExponential(3) // '4.560e+1'- - - -
.toFixed([dp [, rm]]) ⇒ string
-
- dp
: number: integer, 0
to 1e+9
inclusive
- rm
: number: integer, 0
to 8
inclusive
-
- Returns a string representing the value of this BigNumber in normal (fixed-point) notation
- rounded to dp
decimal places using rounding mode rm
.
-
- If the value of this BigNumber in normal notation has fewer than dp
fraction
- digits, the return value will be appended with zeros accordingly.
-
- Unlike Number.prototype.toFixed
, which returns exponential notation if a number
- is greater or equal to 1021
, this method will always return normal
- notation.
-
- If dp
is omitted or is null
or undefined
, the return
- value will be unrounded and in normal notation. This is also unlike
- Number.prototype.toFixed
, which returns the value to zero decimal places.
- It is useful when fixed-point notation is required and the current
- EXPONENTIAL_AT
setting causes
- toString
to return exponential notation.
- If rm
is omitted or is null
or undefined
,
- ROUNDING_MODE
is used.
-
- Throws if dp
or rm
is invalid. See Errors.
-
-x = 3.456 -y = new BigNumber(x) -x.toFixed() // '3' -y.toFixed() // '3.456' -y.toFixed(0) // '3' -x.toFixed(2) // '3.46' -y.toFixed(2) // '3.46' -y.toFixed(2, 1) // '3.45' (ROUND_DOWN) -x.toFixed(5) // '3.45600' -y.toFixed(5) // '3.45600'- - - -
.toFormat([dp [, rm[, format]]]) ⇒ string
-
- dp
: number: integer, 0
to 1e+9
inclusive
- rm
: number: integer, 0
to 8
inclusive
- format
: object: see FORMAT
-
-
- Returns a string representing the value of this BigNumber in normal (fixed-point) notation
- rounded to dp
decimal places using rounding mode rm
, and formatted
- according to the properties of the format
object.
-
- See FORMAT
and the examples below for the properties of the
- format
object, their types, and their usage. A formatting object may contain
- some or all of the recognised properties.
-
- If dp
is omitted or is null
or undefined
, then the
- return value is not rounded to a fixed number of decimal places.
- If rm
is omitted or is null
or undefined
,
- ROUNDING_MODE
is used.
- If format
is omitted or is null
or undefined
, the
- FORMAT
object is used.
-
- Throws if dp
, rm
or format
is invalid. See
- Errors.
-
-fmt = { - prefix = '', - decimalSeparator: '.', - groupSeparator: ',', - groupSize: 3, - secondaryGroupSize: 0, - fractionGroupSeparator: ' ', - fractionGroupSize: 0, - suffix = '' -} - -x = new BigNumber('123456789.123456789') - -// Set the global formatting options -BigNumber.config({ FORMAT: fmt }) - -x.toFormat() // '123,456,789.123456789' -x.toFormat(3) // '123,456,789.123' - -// If a reference to the object assigned to FORMAT has been retained, -// the format properties can be changed directly -fmt.groupSeparator = ' ' -fmt.fractionGroupSize = 5 -x.toFormat() // '123 456 789.12345 6789' - -// Alternatively, pass the formatting options as an argument -fmt = { - prefix: '=> ', - decimalSeparator: ',', - groupSeparator: '.', - groupSize: 3, - secondaryGroupSize: 2 -} - -x.toFormat() // '123 456 789.12345 6789' -x.toFormat(fmt) // '=> 12.34.56.789,123456789' -x.toFormat(2, fmt) // '=> 12.34.56.789,12' -x.toFormat(3, BigNumber.ROUND_UP, fmt) // '=> 12.34.56.789,124'- - - -
.toFraction([maximum_denominator])
- ⇒ [BigNumber, BigNumber]
-
- maximum_denominator
:
- number|string|BigNumber: integer >= 1
and <=
- Infinity
-
- Returns an array of two BigNumbers representing the value of this BigNumber as a simple
- fraction with an integer numerator and an integer denominator. The denominator will be a
- positive non-zero value less than or equal to maximum_denominator
.
-
- If a maximum_denominator
is not specified, or is null
or
- undefined
, the denominator will be the lowest value necessary to represent the
- number exactly.
-
- Throws if maximum_denominator
is invalid. See Errors.
-
-x = new BigNumber(1.75) -x.toFraction() // '7, 4' - -pi = new BigNumber('3.14159265358') -pi.toFraction() // '157079632679,50000000000' -pi.toFraction(100000) // '312689, 99532' -pi.toFraction(10000) // '355, 113' -pi.toFraction(100) // '311, 99' -pi.toFraction(10) // '22, 7' -pi.toFraction(1) // '3, 1'- - - -
.toJSON() ⇒ string
As valueOf
.
-x = new BigNumber('177.7e+457') -y = new BigNumber(235.4325) -z = new BigNumber('0.0098074') - -// Serialize an array of three BigNumbers -str = JSON.stringify( [x, y, z] ) -// "["1.777e+459","235.4325","0.0098074"]" - -// Return an array of three BigNumbers -JSON.parse(str, function (key, val) { - return key === '' ? val : new BigNumber(val) -})- - - -
.toNumber() ⇒ number
Returns the value of this BigNumber as a JavaScript number primitive.
-- This method is identical to using type coercion with the unary plus operator. -
--x = new BigNumber(456.789) -x.toNumber() // 456.789 -+x // 456.789 - -y = new BigNumber('45987349857634085409857349856430985') -y.toNumber() // 4.598734985763409e+34 - -z = new BigNumber(-0) -1 / z.toNumber() // -Infinity -1 / +z // -Infinity- - - -
.toPrecision([sd [, rm]]) ⇒ string
-
- sd
: number: integer, 1
to 1e+9
inclusive
- rm
: number: integer, 0
to 8
inclusive
-
- Returns a string representing the value of this BigNumber rounded to sd
- significant digits using rounding mode rm
.
-
- If sd
is less than the number of digits necessary to represent the integer part
- of the value in normal (fixed-point) notation, then exponential notation is used.
-
- If sd
is omitted, or is null
or undefined
, then the
- return value is the same as n.toString()
.
- If rm
is omitted or is null
or undefined
,
- ROUNDING_MODE
is used.
-
- Throws if sd
or rm
is invalid. See Errors.
-
-x = 45.6 -y = new BigNumber(x) -x.toPrecision() // '45.6' -y.toPrecision() // '45.6' -x.toPrecision(1) // '5e+1' -y.toPrecision(1) // '5e+1' -y.toPrecision(2, 0) // '4.6e+1' (ROUND_UP) -y.toPrecision(2, 1) // '4.5e+1' (ROUND_DOWN) -x.toPrecision(5) // '45.600' -y.toPrecision(5) // '45.600'- - - -
.toString([base]) ⇒ string
- base
: number: integer, 2
to ALPHABET.length
- inclusive (see ALPHABET
).
-
- Returns a string representing the value of this BigNumber in the specified base, or base
- 10
if base
is omitted or is null
or
- undefined
.
-
- For bases above 10
, and using the default base conversion alphabet
- (see ALPHABET
), values from 10
to
- 35
are represented by a-z
- (as with Number.prototype.toString
).
-
- If a base is specified the value is rounded according to the current
- DECIMAL_PLACES
- and ROUNDING_MODE
settings.
-
- If a base is not specified, and this BigNumber has a positive
- exponent that is equal to or greater than the positive component of the
- current EXPONENTIAL_AT
setting,
- or a negative exponent equal to or less than the negative component of the
- setting, then exponential notation is returned.
-
If base
is null
or undefined
it is ignored.
- Throws if base
is invalid. See Errors.
-
-x = new BigNumber(750000) -x.toString() // '750000' -BigNumber.config({ EXPONENTIAL_AT: 5 }) -x.toString() // '7.5e+5' - -y = new BigNumber(362.875) -y.toString(2) // '101101010.111' -y.toString(9) // '442.77777777777777777778' -y.toString(32) // 'ba.s' - -BigNumber.config({ DECIMAL_PLACES: 4 }); -z = new BigNumber('1.23456789') -z.toString() // '1.23456789' -z.toString(10) // '1.2346'- - - -
.valueOf() ⇒ string
- As toString
, but does not accept a base argument and includes
- the minus sign for negative zero.
-
-x = new BigNumber('-0') -x.toString() // '0' -x.valueOf() // '-0' -y = new BigNumber('1.777e+457') -y.valueOf() // '1.777e+457'- - - -
The properties of a BigNumber instance:
-Property | -Description | -Type | -Value | -
---|---|---|---|
c | -coefficient* | -number[] |
- Array of base 1e14 numbers |
-
e | -exponent | -number | -Integer, -1000000000 to 1000000000 inclusive |
-
s | -sign | -number | --1 or 1 |
-
*significand
-
- The value of any of the c
, e
and s
properties may also
- be null
.
-
- The above properties are best considered to be read-only. In early versions of this library it - was okay to change the exponent of a BigNumber by writing to its exponent property directly, - but this is no longer reliable as the value of the first element of the coefficient array is - now dependent on the exponent. -
-- Note that, as with JavaScript numbers, the original exponent and fractional trailing zeros are - not necessarily preserved. -
-x = new BigNumber(0.123) // '0.123' -x.toExponential() // '1.23e-1' -x.c // '1,2,3' -x.e // -1 -x.s // 1 - -y = new Number(-123.4567000e+2) // '-12345.67' -y.toExponential() // '-1.234567e+4' -z = new BigNumber('-123.4567000e+2') // '-12345.67' -z.toExponential() // '-1.234567e+4' -z.c // '1,2,3,4,5,6,7' -z.e // 4 -z.s // -1- - - -
- The table below shows how ±0
, NaN
and
- ±Infinity
are stored.
-
- | c | -e | -s | -
---|---|---|---|
±0 | -[0] |
- 0 |
- ±1 |
-
NaN | -null |
- null |
- null |
-
±Infinity | -null |
- null |
- ±1 |
-
-x = new Number(-0) // 0 -1 / x == -Infinity // true - -y = new BigNumber(-0) // '0' -y.c // '0' ( [0].toString() ) -y.e // 0 -y.s // -1- - - -
The table below shows the errors that are thrown.
-
- The errors are generic Error
objects whose message begins
- '[BigNumber Error]'
.
-
Method | -Throws | -
---|---|
- BigNumber - comparedTo - dividedBy - dividedToIntegerBy - isEqualTo - isGreaterThan - isGreaterThanOrEqualTo - isLessThan - isLessThanOrEqualTo - minus - modulo - plus - multipliedBy
- |
- Base not a primitive number | -
Base not an integer | -|
Base out of range | -|
Number primitive has more than 15 significant digits* | -|
Not a base... number* | -|
Not a number* | -|
clone |
- Object expected | -
config |
- Object expected | -
DECIMAL_PLACES not a primitive number |
- |
DECIMAL_PLACES not an integer |
- |
DECIMAL_PLACES out of range |
- |
ROUNDING_MODE not a primitive number |
- |
ROUNDING_MODE not an integer |
- |
ROUNDING_MODE out of range |
- |
EXPONENTIAL_AT not a primitive number |
- |
EXPONENTIAL_AT not an integer |
- |
EXPONENTIAL_AT out of range |
- |
RANGE not a primitive number |
- |
RANGE not an integer |
- |
RANGE cannot be zero |
- |
RANGE cannot be zero |
- |
CRYPTO not true or false |
- |
crypto unavailable |
- |
MODULO_MODE not a primitive number |
- |
MODULO_MODE not an integer |
- |
MODULO_MODE out of range |
- |
POW_PRECISION not a primitive number |
- |
POW_PRECISION not an integer |
- |
POW_PRECISION out of range |
- |
FORMAT not an object |
- |
ALPHABET invalid |
- |
- decimalPlaces - precision - random - shiftedBy - toExponential - toFixed - toFormat - toPrecision
- |
- Argument not a primitive number | -
Argument not an integer | -|
Argument out of range | -|
- decimalPlaces - precision
- |
- Argument not true or false | -
exponentiatedBy |
- Argument not an integer | -
isBigNumber |
- Invalid BigNumber* | -
- minimum - maximum
- |
- Not a number* | -
- random
- |
- crypto unavailable | -
- toFormat
- |
- Argument not an object | -
toFraction |
- Argument not an integer | -
Argument out of range | -|
toString |
- Base not a primitive number | -
Base not an integer | -|
Base out of range | -
*Only thrown if BigNumber.DEBUG
is true
.
To determine if an exception is a BigNumber Error:
--try { - // ... -} catch (e) { - if (e instanceof Error && e.message.indexOf('[BigNumber Error]') === 0) { - // ... - } -}- - - -
- To prevent the accidental use of a BigNumber in primitive number operations, or the
- accidental addition of a BigNumber to a string, the valueOf
method can be safely
- overwritten as shown below.
-
- The valueOf
method is the same as the
- toJSON
method, and both are the same as the
- toString
method except they do not take a base
- argument and they include the minus sign for negative zero.
-
-BigNumber.prototype.valueOf = function () { - throw Error('valueOf called!') -} - -x = new BigNumber(1) -x / 2 // '[BigNumber Error] valueOf called!' -x + 'abc' // '[BigNumber Error] valueOf called!' -- - - -
- Some arbitrary-precision libraries retain trailing fractional zeros as they can indicate the - precision of a value. This can be useful but the results of arithmetic operations can be - misleading. -
--x = new BigDecimal("1.0") -y = new BigDecimal("1.1000") -z = x.add(y) // 2.1000 - -x = new BigDecimal("1.20") -y = new BigDecimal("3.45000") -z = x.multiply(y) // 4.1400000-
- To specify the precision of a value is to specify that the value lies - within a certain range. -
-
- In the first example, x
has a value of 1.0
. The trailing zero shows
- the precision of the value, implying that it is in the range 0.95
to
- 1.05
. Similarly, the precision indicated by the trailing zeros of y
- indicates that the value is in the range 1.09995
to 1.10005
.
-
- If we add the two lowest values in the ranges we have, 0.95 + 1.09995 = 2.04995
,
- and if we add the two highest values we have, 1.05 + 1.10005 = 2.15005
, so the
- range of the result of the addition implied by the precision of its operands is
- 2.04995
to 2.15005
.
-
- The result given by BigDecimal of 2.1000
however, indicates that the value is in
- the range 2.09995
to 2.10005
and therefore the precision implied by
- its trailing zeros may be misleading.
-
- In the second example, the true range is 4.122744
to 4.157256
yet
- the BigDecimal answer of 4.1400000
indicates a range of 4.13999995
- to 4.14000005
. Again, the precision implied by the trailing zeros may be
- misleading.
-
- This library, like binary floating point and most calculators, does not retain trailing
- fractional zeros. Instead, the toExponential
, toFixed
and
- toPrecision
methods enable trailing zeros to be added if and when required.
-
Welcome back, ' + escapeHtml(name) + '!
'); - } else { - res.write('Hello, new visitor!
'); - } - - res.write(''); -} - -http.createServer(onRequest).listen(3000); -``` - -## Testing - -```sh -$ npm test -``` - -## Benchmark - -``` -$ npm run bench - -> cookie@0.3.1 bench cookie -> node benchmark/index.js - - http_parser@2.8.0 - node@6.14.2 - v8@5.1.281.111 - uv@1.16.1 - zlib@1.2.11 - ares@1.10.1-DEV - icu@58.2 - modules@48 - napi@3 - openssl@1.0.2o - -> node benchmark/parse.js - - cookie.parse - - 6 tests completed. - - simple x 1,200,691 ops/sec ±1.12% (189 runs sampled) - decode x 1,012,994 ops/sec ±0.97% (186 runs sampled) - unquote x 1,074,174 ops/sec ±2.43% (186 runs sampled) - duplicates x 438,424 ops/sec ±2.17% (184 runs sampled) - 10 cookies x 147,154 ops/sec ±1.01% (186 runs sampled) - 100 cookies x 14,274 ops/sec ±1.07% (187 runs sampled) -``` - -## References - -- [RFC 6265: HTTP State Management Mechanism][rfc-6265] -- [Same-site Cookies][rfc-6265bis-03-4.1.2.7] - -[rfc-6265bis-03-4.1.2.7]: https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-03#section-4.1.2.7 -[rfc-6265]: https://tools.ietf.org/html/rfc6265 -[rfc-6265-5.1.4]: https://tools.ietf.org/html/rfc6265#section-5.1.4 -[rfc-6265-5.2.1]: https://tools.ietf.org/html/rfc6265#section-5.2.1 -[rfc-6265-5.2.2]: https://tools.ietf.org/html/rfc6265#section-5.2.2 -[rfc-6265-5.2.3]: https://tools.ietf.org/html/rfc6265#section-5.2.3 -[rfc-6265-5.2.4]: https://tools.ietf.org/html/rfc6265#section-5.2.4 -[rfc-6265-5.2.5]: https://tools.ietf.org/html/rfc6265#section-5.2.5 -[rfc-6265-5.2.6]: https://tools.ietf.org/html/rfc6265#section-5.2.6 -[rfc-6265-5.3]: https://tools.ietf.org/html/rfc6265#section-5.3 - -## License - -[MIT](LICENSE) - -[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/cookie/master -[coveralls-url]: https://coveralls.io/r/jshttp/cookie?branch=master -[node-version-image]: https://badgen.net/npm/node/cookie -[node-version-url]: https://nodejs.org/en/download -[npm-downloads-image]: https://badgen.net/npm/dm/cookie -[npm-url]: https://npmjs.org/package/cookie -[npm-version-image]: https://badgen.net/npm/v/cookie -[travis-image]: https://badgen.net/travis/jshttp/cookie/master -[travis-url]: https://travis-ci.org/jshttp/cookie diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/cookie/index.js" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/cookie/index.js" deleted file mode 100644 index 760f32e5d6af2e682cd6fe4d736ab4aa51f3918d..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/cookie/index.js" +++ /dev/null @@ -1,202 +0,0 @@ -/*! - * cookie - * Copyright(c) 2012-2014 Roman Shtylman - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict'; - -/** - * Module exports. - * @public - */ - -exports.parse = parse; -exports.serialize = serialize; - -/** - * Module variables. - * @private - */ - -var decode = decodeURIComponent; -var encode = encodeURIComponent; -var pairSplitRegExp = /; */; - -/** - * RegExp to match field-content in RFC 7230 sec 3.2 - * - * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ] - * field-vchar = VCHAR / obs-text - * obs-text = %x80-FF - */ - -var fieldContentRegExp = /^[\u0009\u0020-\u007e\u0080-\u00ff]+$/; - -/** - * Parse a cookie header. - * - * Parse the given cookie header string into an object - * The object has the various cookies as keys(names) => values - * - * @param {string} str - * @param {object} [options] - * @return {object} - * @public - */ - -function parse(str, options) { - if (typeof str !== 'string') { - throw new TypeError('argument str must be a string'); - } - - var obj = {} - var opt = options || {}; - var pairs = str.split(pairSplitRegExp); - var dec = opt.decode || decode; - - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i]; - var eq_idx = pair.indexOf('='); - - // skip things that don't look like key=value - if (eq_idx < 0) { - continue; - } - - var key = pair.substr(0, eq_idx).trim() - var val = pair.substr(++eq_idx, pair.length).trim(); - - // quoted values - if ('"' == val[0]) { - val = val.slice(1, -1); - } - - // only assign once - if (undefined == obj[key]) { - obj[key] = tryDecode(val, dec); - } - } - - return obj; -} - -/** - * Serialize data into a cookie header. - * - * Serialize the a name value pair into a cookie string suitable for - * http headers. An optional options object specified cookie parameters. - * - * serialize('foo', 'bar', { httpOnly: true }) - * => "foo=bar; httpOnly" - * - * @param {string} name - * @param {string} val - * @param {object} [options] - * @return {string} - * @public - */ - -function serialize(name, val, options) { - var opt = options || {}; - var enc = opt.encode || encode; - - if (typeof enc !== 'function') { - throw new TypeError('option encode is invalid'); - } - - if (!fieldContentRegExp.test(name)) { - throw new TypeError('argument name is invalid'); - } - - var value = enc(val); - - if (value && !fieldContentRegExp.test(value)) { - throw new TypeError('argument val is invalid'); - } - - var str = name + '=' + value; - - if (null != opt.maxAge) { - var maxAge = opt.maxAge - 0; - - if (isNaN(maxAge) || !isFinite(maxAge)) { - throw new TypeError('option maxAge is invalid') - } - - str += '; Max-Age=' + Math.floor(maxAge); - } - - if (opt.domain) { - if (!fieldContentRegExp.test(opt.domain)) { - throw new TypeError('option domain is invalid'); - } - - str += '; Domain=' + opt.domain; - } - - if (opt.path) { - if (!fieldContentRegExp.test(opt.path)) { - throw new TypeError('option path is invalid'); - } - - str += '; Path=' + opt.path; - } - - if (opt.expires) { - if (typeof opt.expires.toUTCString !== 'function') { - throw new TypeError('option expires is invalid'); - } - - str += '; Expires=' + opt.expires.toUTCString(); - } - - if (opt.httpOnly) { - str += '; HttpOnly'; - } - - if (opt.secure) { - str += '; Secure'; - } - - if (opt.sameSite) { - var sameSite = typeof opt.sameSite === 'string' - ? opt.sameSite.toLowerCase() : opt.sameSite; - - switch (sameSite) { - case true: - str += '; SameSite=Strict'; - break; - case 'lax': - str += '; SameSite=Lax'; - break; - case 'strict': - str += '; SameSite=Strict'; - break; - case 'none': - str += '; SameSite=None'; - break; - default: - throw new TypeError('option sameSite is invalid'); - } - } - - return str; -} - -/** - * Try decoding a string using a decoding function. - * - * @param {string} str - * @param {function} decode - * @private - */ - -function tryDecode(str, decode) { - try { - return decode(str); - } catch (e) { - return str; - } -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/cookie/package.json" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/cookie/package.json" deleted file mode 100644 index cdbd55a93f5a9a6fd291d2a3438060e6a40356b5..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/cookie/package.json" +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_from": "cookie@0.4.1", - "_id": "cookie@0.4.1", - "_inBundle": false, - "_integrity": "sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA==", - "_location": "/cookie", - "_phantomChildren": {}, - "_requested": { - "type": "version", - "registry": true, - "raw": "cookie@0.4.1", - "name": "cookie", - "escapedName": "cookie", - "rawSpec": "0.4.1", - "saveSpec": null, - "fetchSpec": "0.4.1" - }, - "_requiredBy": [ - "/express" - ], - "_resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.1.tgz", - "_shasum": "afd713fe26ebd21ba95ceb61f9a8116e50a537d1", - "_spec": "cookie@0.4.1", - "_where": "C:\\Users\\Administrator\\Desktop\\student\\node_modules\\express", - "author": { - "name": "Roman Shtylman", - "email": "shtylman@gmail.com" - }, - "bugs": { - "url": "https://github.com/jshttp/cookie/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - } - ], - "deprecated": false, - "description": "HTTP server cookie parsing and serialization", - "devDependencies": { - "beautify-benchmark": "0.2.4", - "benchmark": "2.1.4", - "eslint": "6.8.0", - "eslint-plugin-markdown": "1.0.2", - "mocha": "7.1.1", - "nyc": "15.0.1" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "HISTORY.md", - "LICENSE", - "README.md", - "index.js" - ], - "homepage": "https://github.com/jshttp/cookie#readme", - "keywords": [ - "cookie", - "cookies" - ], - "license": "MIT", - "name": "cookie", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/cookie.git" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail --check-leaks --ui qunit test/", - "test-ci": "nyc --reporter=text npm test", - "test-cov": "nyc --reporter=html --reporter=text npm test", - "version": "node scripts/version-history.js && git add HISTORY.md" - }, - "version": "0.4.1" -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/LICENSE" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/LICENSE" deleted file mode 100644 index d8d7f9437dbf5ad54701a187f05988bcf0006fd8..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/LICENSE" +++ /dev/null @@ -1,19 +0,0 @@ -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/README.md" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/README.md" deleted file mode 100644 index 5a76b4149c5eb5077c09578e349820bccbbd266e..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/README.md" +++ /dev/null @@ -1,3 +0,0 @@ -# core-util-is - -The `util.is*` functions introduced in Node v0.12. diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/lib/util.js" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/lib/util.js" deleted file mode 100644 index 6e5a20d7dc09e280bf06302f4f872b8eb168aac0..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/lib/util.js" +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. - -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = require('buffer').Buffer.isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/package.json" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/package.json" deleted file mode 100644 index 59b0498c085ae23ece1a040234adf927c2511eb8..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/core-util-is/package.json" +++ /dev/null @@ -1,68 +0,0 @@ -{ - "_from": "core-util-is@~1.0.0", - "_id": "core-util-is@1.0.3", - "_inBundle": false, - "_integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", - "_location": "/core-util-is", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "core-util-is@~1.0.0", - "name": "core-util-is", - "escapedName": "core-util-is", - "rawSpec": "~1.0.0", - "saveSpec": null, - "fetchSpec": "~1.0.0" - }, - "_requiredBy": [ - "/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "_shasum": "a6042d3634c2b27e9328f837b965fac83808db85", - "_spec": "core-util-is@~1.0.0", - "_where": "C:\\Users\\Administrator\\Desktop\\student\\node_modules\\readable-stream", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "The `util.is*` functions introduced in Node v0.12.", - "devDependencies": { - "tap": "^15.0.9" - }, - "files": [ - "lib" - ], - "homepage": "https://github.com/isaacs/core-util-is#readme", - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "license": "MIT", - "main": "lib/util.js", - "name": "core-util-is", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" - }, - "scripts": { - "postversion": "npm publish", - "prepublishOnly": "git push origin --follow-tags", - "preversion": "npm test", - "test": "tap test.js" - }, - "version": "1.0.3" -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.coveralls.yml" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.coveralls.yml" deleted file mode 100644 index 20a7068581791335487166ddc5001a2ca3a3b060..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.coveralls.yml" +++ /dev/null @@ -1 +0,0 @@ -repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.eslintrc" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.eslintrc" deleted file mode 100644 index 8a37ae2c2e5a35db74b4607b4c74e0f4fe39a3e4..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.eslintrc" +++ /dev/null @@ -1,11 +0,0 @@ -{ - "env": { - "browser": true, - "node": true - }, - "rules": { - "no-console": 0, - "no-empty": [1, { "allowEmptyCatch": true }] - }, - "extends": "eslint:recommended" -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.npmignore" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.npmignore" deleted file mode 100644 index 5f60eecc84e219e52554407ad38d04abd1cf2111..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.npmignore" +++ /dev/null @@ -1,9 +0,0 @@ -support -test -examples -example -*.sock -dist -yarn.lock -coverage -bower.json diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.travis.yml" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.travis.yml" deleted file mode 100644 index 6c6090c3b09f2e45d8c0a1dc77ff5f4a81e78a3c..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/.travis.yml" +++ /dev/null @@ -1,14 +0,0 @@ - -language: node_js -node_js: - - "6" - - "5" - - "4" - -install: - - make node_modules - -script: - - make lint - - make test - - make coveralls diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/CHANGELOG.md" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/CHANGELOG.md" deleted file mode 100644 index eadaa189517bbcfb2a6784a48ac8d05d2edafe7c..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/CHANGELOG.md" +++ /dev/null @@ -1,362 +0,0 @@ - -2.6.9 / 2017-09-22 -================== - - * remove ReDoS regexp in %o formatter (#504) - -2.6.8 / 2017-05-18 -================== - - * Fix: Check for undefined on browser globals (#462, @marbemac) - -2.6.7 / 2017-05-16 -================== - - * Fix: Update ms to 2.0.0 to fix regular expression denial of service vulnerability (#458, @hubdotcom) - * Fix: Inline extend function in node implementation (#452, @dougwilson) - * Docs: Fix typo (#455, @msasad) - -2.6.5 / 2017-04-27 -================== - - * Fix: null reference check on window.documentElement.style.WebkitAppearance (#447, @thebigredgeek) - * Misc: clean up browser reference checks (#447, @thebigredgeek) - * Misc: add npm-debug.log to .gitignore (@thebigredgeek) - - -2.6.4 / 2017-04-20 -================== - - * Fix: bug that would occure if process.env.DEBUG is a non-string value. (#444, @LucianBuzzo) - * Chore: ignore bower.json in npm installations. (#437, @joaovieira) - * Misc: update "ms" to v0.7.3 (@tootallnate) - -2.6.3 / 2017-03-13 -================== - - * Fix: Electron reference to `process.env.DEBUG` (#431, @paulcbetts) - * Docs: Changelog fix (@thebigredgeek) - -2.6.2 / 2017-03-10 -================== - - * Fix: DEBUG_MAX_ARRAY_LENGTH (#420, @slavaGanzin) - * Docs: Add backers and sponsors from Open Collective (#422, @piamancini) - * Docs: Add Slackin invite badge (@tootallnate) - -2.6.1 / 2017-02-10 -================== - - * Fix: Module's `export default` syntax fix for IE8 `Expected identifier` error - * Fix: Whitelist DEBUG_FD for values 1 and 2 only (#415, @pi0) - * Fix: IE8 "Expected identifier" error (#414, @vgoma) - * Fix: Namespaces would not disable once enabled (#409, @musikov) - -2.6.0 / 2016-12-28 -================== - - * Fix: added better null pointer checks for browser useColors (@thebigredgeek) - * Improvement: removed explicit `window.debug` export (#404, @tootallnate) - * Improvement: deprecated `DEBUG_FD` environment variable (#405, @tootallnate) - -2.5.2 / 2016-12-25 -================== - - * Fix: reference error on window within webworkers (#393, @KlausTrainer) - * Docs: fixed README typo (#391, @lurch) - * Docs: added notice about v3 api discussion (@thebigredgeek) - -2.5.1 / 2016-12-20 -================== - - * Fix: babel-core compatibility - -2.5.0 / 2016-12-20 -================== - - * Fix: wrong reference in bower file (@thebigredgeek) - * Fix: webworker compatibility (@thebigredgeek) - * Fix: output formatting issue (#388, @kribblo) - * Fix: babel-loader compatibility (#383, @escwald) - * Misc: removed built asset from repo and publications (@thebigredgeek) - * Misc: moved source files to /src (#378, @yamikuronue) - * Test: added karma integration and replaced babel with browserify for browser tests (#378, @yamikuronue) - * Test: coveralls integration (#378, @yamikuronue) - * Docs: simplified language in the opening paragraph (#373, @yamikuronue) - -2.4.5 / 2016-12-17 -================== - - * Fix: `navigator` undefined in Rhino (#376, @jochenberger) - * Fix: custom log function (#379, @hsiliev) - * Improvement: bit of cleanup + linting fixes (@thebigredgeek) - * Improvement: rm non-maintainted `dist/` dir (#375, @freewil) - * Docs: simplified language in the opening paragraph. (#373, @yamikuronue) - -2.4.4 / 2016-12-14 -================== - - * Fix: work around debug being loaded in preload scripts for electron (#368, @paulcbetts) - -2.4.3 / 2016-12-14 -================== - - * Fix: navigation.userAgent error for react native (#364, @escwald) - -2.4.2 / 2016-12-14 -================== - - * Fix: browser colors (#367, @tootallnate) - * Misc: travis ci integration (@thebigredgeek) - * Misc: added linting and testing boilerplate with sanity check (@thebigredgeek) - -2.4.1 / 2016-12-13 -================== - - * Fix: typo that broke the package (#356) - -2.4.0 / 2016-12-13 -================== - - * Fix: bower.json references unbuilt src entry point (#342, @justmatt) - * Fix: revert "handle regex special characters" (@tootallnate) - * Feature: configurable util.inspect()`options for NodeJS (#327, @tootallnate) - * Feature: %O`(big O) pretty-prints objects (#322, @tootallnate) - * Improvement: allow colors in workers (#335, @botverse) - * Improvement: use same color for same namespace. (#338, @lchenay) - -2.3.3 / 2016-11-09 -================== - - * Fix: Catch `JSON.stringify()` errors (#195, Jovan Alleyne) - * Fix: Returning `localStorage` saved values (#331, Levi Thomason) - * Improvement: Don't create an empty object when no `process` (Nathan Rajlich) - -2.3.2 / 2016-11-09 -================== - - * Fix: be super-safe in index.js as well (@TooTallNate) - * Fix: should check whether process exists (Tom Newby) - -2.3.1 / 2016-11-09 -================== - - * Fix: Added electron compatibility (#324, @paulcbetts) - * Improvement: Added performance optimizations (@tootallnate) - * Readme: Corrected PowerShell environment variable example (#252, @gimre) - * Misc: Removed yarn lock file from source control (#321, @fengmk2) - -2.3.0 / 2016-11-07 -================== - - * Fix: Consistent placement of ms diff at end of output (#215, @gorangajic) - * Fix: Escaping of regex special characters in namespace strings (#250, @zacronos) - * Fix: Fixed bug causing crash on react-native (#282, @vkarpov15) - * Feature: Enabled ES6+ compatible import via default export (#212 @bucaran) - * Feature: Added %O formatter to reflect Chrome's console.log capability (#279, @oncletom) - * Package: Update "ms" to 0.7.2 (#315, @DevSide) - * Package: removed superfluous version property from bower.json (#207 @kkirsche) - * Readme: fix USE_COLORS to DEBUG_COLORS - * Readme: Doc fixes for format string sugar (#269, @mlucool) - * Readme: Updated docs for DEBUG_FD and DEBUG_COLORS environment variables (#232, @mattlyons0) - * Readme: doc fixes for PowerShell (#271 #243, @exoticknight @unreadable) - * Readme: better docs for browser support (#224, @matthewmueller) - * Tooling: Added yarn integration for development (#317, @thebigredgeek) - * Misc: Renamed History.md to CHANGELOG.md (@thebigredgeek) - * Misc: Added license file (#226 #274, @CantemoInternal @sdaitzman) - * Misc: Updated contributors (@thebigredgeek) - -2.2.0 / 2015-05-09 -================== - - * package: update "ms" to v0.7.1 (#202, @dougwilson) - * README: add logging to file example (#193, @DanielOchoa) - * README: fixed a typo (#191, @amir-s) - * browser: expose `storage` (#190, @stephenmathieson) - * Makefile: add a `distclean` target (#189, @stephenmathieson) - -2.1.3 / 2015-03-13 -================== - - * Updated stdout/stderr example (#186) - * Updated example/stdout.js to match debug current behaviour - * Renamed example/stderr.js to stdout.js - * Update Readme.md (#184) - * replace high intensity foreground color for bold (#182, #183) - -2.1.2 / 2015-03-01 -================== - - * dist: recompile - * update "ms" to v0.7.0 - * package: update "browserify" to v9.0.3 - * component: fix "ms.js" repo location - * changed bower package name - * updated documentation about using debug in a browser - * fix: security error on safari (#167, #168, @yields) - -2.1.1 / 2014-12-29 -================== - - * browser: use `typeof` to check for `console` existence - * browser: check for `console.log` truthiness (fix IE 8/9) - * browser: add support for Chrome apps - * Readme: added Windows usage remarks - * Add `bower.json` to properly support bower install - -2.1.0 / 2014-10-15 -================== - - * node: implement `DEBUG_FD` env variable support - * package: update "browserify" to v6.1.0 - * package: add "license" field to package.json (#135, @panuhorsmalahti) - -2.0.0 / 2014-09-01 -================== - - * package: update "browserify" to v5.11.0 - * node: use stderr rather than stdout for logging (#29, @stephenmathieson) - -1.0.4 / 2014-07-15 -================== - - * dist: recompile - * example: remove `console.info()` log usage - * example: add "Content-Type" UTF-8 header to browser example - * browser: place %c marker after the space character - * browser: reset the "content" color via `color: inherit` - * browser: add colors support for Firefox >= v31 - * debug: prefer an instance `log()` function over the global one (#119) - * Readme: update documentation about styled console logs for FF v31 (#116, @wryk) - -1.0.3 / 2014-07-09 -================== - - * Add support for multiple wildcards in namespaces (#122, @seegno) - * browser: fix lint - -1.0.2 / 2014-06-10 -================== - - * browser: update color palette (#113, @gscottolson) - * common: make console logging function configurable (#108, @timoxley) - * node: fix %o colors on old node <= 0.8.x - * Makefile: find node path using shell/which (#109, @timoxley) - -1.0.1 / 2014-06-06 -================== - - * browser: use `removeItem()` to clear localStorage - * browser, node: don't set DEBUG if namespaces is undefined (#107, @leedm777) - * package: add "contributors" section - * node: fix comment typo - * README: list authors - -1.0.0 / 2014-06-04 -================== - - * make ms diff be global, not be scope - * debug: ignore empty strings in enable() - * node: make DEBUG_COLORS able to disable coloring - * *: export the `colors` array - * npmignore: don't publish the `dist` dir - * Makefile: refactor to use browserify - * package: add "browserify" as a dev dependency - * Readme: add Web Inspector Colors section - * node: reset terminal color for the debug content - * node: map "%o" to `util.inspect()` - * browser: map "%j" to `JSON.stringify()` - * debug: add custom "formatters" - * debug: use "ms" module for humanizing the diff - * Readme: add "bash" syntax highlighting - * browser: add Firebug color support - * browser: add colors for WebKit browsers - * node: apply log to `console` - * rewrite: abstract common logic for Node & browsers - * add .jshintrc file - -0.8.1 / 2014-04-14 -================== - - * package: re-add the "component" section - -0.8.0 / 2014-03-30 -================== - - * add `enable()` method for nodejs. Closes #27 - * change from stderr to stdout - * remove unnecessary index.js file - -0.7.4 / 2013-11-13 -================== - - * remove "browserify" key from package.json (fixes something in browserify) - -0.7.3 / 2013-10-30 -================== - - * fix: catch localStorage security error when cookies are blocked (Chrome) - * add debug(err) support. Closes #46 - * add .browser prop to package.json. Closes #42 - -0.7.2 / 2013-02-06 -================== - - * fix package.json - * fix: Mobile Safari (private mode) is broken with debug - * fix: Use unicode to send escape character to shell instead of octal to work with strict mode javascript - -0.7.1 / 2013-02-05 -================== - - * add repository URL to package.json - * add DEBUG_COLORED to force colored output - * add browserify support - * fix component. Closes #24 - -0.7.0 / 2012-05-04 -================== - - * Added .component to package.json - * Added debug.component.js build - -0.6.0 / 2012-03-16 -================== - - * Added support for "-" prefix in DEBUG [Vinay Pulim] - * Added `.enabled` flag to the node version [TooTallNate] - -0.5.0 / 2012-02-02 -================== - - * Added: humanize diffs. Closes #8 - * Added `debug.disable()` to the CS variant - * Removed padding. Closes #10 - * Fixed: persist client-side variant again. Closes #9 - -0.4.0 / 2012-02-01 -================== - - * Added browser variant support for older browsers [TooTallNate] - * Added `debug.enable('project:*')` to browser variant [TooTallNate] - * Added padding to diff (moved it to the right) - -0.3.0 / 2012-01-26 -================== - - * Added millisecond diff when isatty, otherwise UTC string - -0.2.0 / 2012-01-22 -================== - - * Added wildcard support - -0.1.0 / 2011-12-02 -================== - - * Added: remove colors unless stderr isatty [TooTallNate] - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/LICENSE" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/LICENSE" deleted file mode 100644 index 658c933d28255e8c716899789e8c0f846e5dc125..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/debug/LICENSE" +++ /dev/null @@ -1,19 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 TJ HolowaychukLocation ' + escapeHtml(url) + ' not found
' - - // send a 404 - res.statusCode = 404 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) - res.end(body, 'utf-8') -}) -``` - -### Encode a URL for use in a header field - -```js -var encodeUrl = require('encodeurl') -var escapeHtml = require('escape-html') -var url = require('url') - -http.createServer(function onRequest (req, res) { - // parse inbound url - var href = url.parse(req) - - // set new host for redirect - href.host = 'localhost' - href.protocol = 'https:' - href.slashes = true - - // create location header - var location = encodeUrl(url.format(href)) - - // create html message - var body = 'Redirecting to new site: ' + escapeHtml(location) + '
' - - // send a 301 - res.statusCode = 301 - res.setHeader('Content-Type', 'text/html; charset=UTF-8') - res.setHeader('Content-Length', String(Buffer.byteLength(body, 'utf-8'))) - res.setHeader('Location', location) - res.end(body, 'utf-8') -}) -``` - -## Testing - -```sh -$ npm test -$ npm run lint -``` - -## References - -- [RFC 3986: Uniform Resource Identifier (URI): Generic Syntax][rfc-3986] -- [WHATWG URL Living Standard][whatwg-url] - -[rfc-3986]: https://tools.ietf.org/html/rfc3986 -[whatwg-url]: https://url.spec.whatwg.org/ - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/encodeurl.svg -[npm-url]: https://npmjs.org/package/encodeurl -[node-version-image]: https://img.shields.io/node/v/encodeurl.svg -[node-version-url]: https://nodejs.org/en/download -[travis-image]: https://img.shields.io/travis/pillarjs/encodeurl.svg -[travis-url]: https://travis-ci.org/pillarjs/encodeurl -[coveralls-image]: https://img.shields.io/coveralls/pillarjs/encodeurl.svg -[coveralls-url]: https://coveralls.io/r/pillarjs/encodeurl?branch=master -[downloads-image]: https://img.shields.io/npm/dm/encodeurl.svg -[downloads-url]: https://npmjs.org/package/encodeurl diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/encodeurl/index.js" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/encodeurl/index.js" deleted file mode 100644 index fc4906c6c7896396a877e1f369c78f804e3afa10..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/encodeurl/index.js" +++ /dev/null @@ -1,60 +0,0 @@ -/*! - * encodeurl - * Copyright(c) 2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = encodeUrl - -/** - * RegExp to match non-URL code points, *after* encoding (i.e. not including "%") - * and including invalid escape sequences. - * @private - */ - -var ENCODE_CHARS_REGEXP = /(?:[^\x21\x25\x26-\x3B\x3D\x3F-\x5B\x5D\x5F\x61-\x7A\x7E]|%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|$))+/g - -/** - * RegExp to match unmatched surrogate pair. - * @private - */ - -var UNMATCHED_SURROGATE_PAIR_REGEXP = /(^|[^\uD800-\uDBFF])[\uDC00-\uDFFF]|[\uD800-\uDBFF]([^\uDC00-\uDFFF]|$)/g - -/** - * String to replace unmatched surrogate pair with. - * @private - */ - -var UNMATCHED_SURROGATE_PAIR_REPLACE = '$1\uFFFD$2' - -/** - * Encode a URL to a percent-encoded form, excluding already-encoded sequences. - * - * This function will take an already-encoded URL and encode all the non-URL - * code points. This function will not encode the "%" character unless it is - * not part of a valid sequence (`%20` will be left as-is, but `%foo` will - * be encoded as `%25foo`). - * - * This encode is meant to be "safe" and does not throw errors. It will try as - * hard as it can to properly encode the given URL, including replacing any raw, - * unpaired surrogate pairs with the Unicode replacement character prior to - * encoding. - * - * @param {string} url - * @return {string} - * @public - */ - -function encodeUrl (url) { - return String(url) - .replace(UNMATCHED_SURROGATE_PAIR_REGEXP, UNMATCHED_SURROGATE_PAIR_REPLACE) - .replace(ENCODE_CHARS_REGEXP, encodeURI) -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/encodeurl/package.json" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/encodeurl/package.json" deleted file mode 100644 index fad115ec159bf0c7a25d3a748c2dc0faa3a68b3a..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/encodeurl/package.json" +++ /dev/null @@ -1,78 +0,0 @@ -{ - "_from": "encodeurl@~1.0.2", - "_id": "encodeurl@1.0.2", - "_inBundle": false, - "_integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "_location": "/encodeurl", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "encodeurl@~1.0.2", - "name": "encodeurl", - "escapedName": "encodeurl", - "rawSpec": "~1.0.2", - "saveSpec": null, - "fetchSpec": "~1.0.2" - }, - "_requiredBy": [ - "/express", - "/finalhandler", - "/send", - "/serve-static" - ], - "_resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "_shasum": "ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59", - "_spec": "encodeurl@~1.0.2", - "_where": "C:\\Users\\Administrator\\Desktop\\student\\node_modules\\express", - "bugs": { - "url": "https://github.com/pillarjs/encodeurl/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - } - ], - "deprecated": false, - "description": "Encode a URL to a percent-encoded form, excluding already-encoded sequences", - "devDependencies": { - "eslint": "3.19.0", - "eslint-config-standard": "10.2.1", - "eslint-plugin-import": "2.8.0", - "eslint-plugin-node": "5.2.1", - "eslint-plugin-promise": "3.6.0", - "eslint-plugin-standard": "3.0.1", - "istanbul": "0.4.5", - "mocha": "2.5.3" - }, - "engines": { - "node": ">= 0.8" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "homepage": "https://github.com/pillarjs/encodeurl#readme", - "keywords": [ - "encode", - "encodeurl", - "url" - ], - "license": "MIT", - "name": "encodeurl", - "repository": { - "type": "git", - "url": "git+https://github.com/pillarjs/encodeurl.git" - }, - "scripts": { - "lint": "eslint .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "1.0.2" -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/LICENSE" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/LICENSE" deleted file mode 100644 index 2e70de9717e715b4fc05c7f8bdc4e8d63a33b859..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/LICENSE" +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012-2013 TJ Holowaychuk -Copyright (c) 2015 Andreas Lubbe -Copyright (c) 2015 Tiancheng "Timothy" Gu - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/Readme.md" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/Readme.md" deleted file mode 100644 index 653d9eaa793317827ce724c4a0756110e9356fc8..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/Readme.md" +++ /dev/null @@ -1,43 +0,0 @@ - -# escape-html - - Escape string for use in HTML - -## Example - -```js -var escape = require('escape-html'); -var html = escape('foo & bar'); -// -> foo & bar -``` - -## Benchmark - -``` -$ npm run-script bench - -> escape-html@1.0.3 bench nodejs-escape-html -> node benchmark/index.js - - - http_parser@1.0 - node@0.10.33 - v8@3.14.5.9 - ares@1.9.0-DEV - uv@0.10.29 - zlib@1.2.3 - modules@11 - openssl@1.0.1j - - 1 test completed. - 2 tests completed. - 3 tests completed. - - no special characters x 19,435,271 ops/sec ±0.85% (187 runs sampled) - single special character x 6,132,421 ops/sec ±0.67% (194 runs sampled) - many special characters x 3,175,826 ops/sec ±0.65% (193 runs sampled) -``` - -## License - - MIT \ No newline at end of file diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/index.js" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/index.js" deleted file mode 100644 index bf9e226f4e872bee53a930739e5381d013c47568..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/index.js" +++ /dev/null @@ -1,78 +0,0 @@ -/*! - * escape-html - * Copyright(c) 2012-2013 TJ Holowaychuk - * Copyright(c) 2015 Andreas Lubbe - * Copyright(c) 2015 Tiancheng "Timothy" Gu - * MIT Licensed - */ - -'use strict'; - -/** - * Module variables. - * @private - */ - -var matchHtmlRegExp = /["'&<>]/; - -/** - * Module exports. - * @public - */ - -module.exports = escapeHtml; - -/** - * Escape special characters in the given string of html. - * - * @param {string} string The string to escape for inserting into HTML - * @return {string} - * @public - */ - -function escapeHtml(string) { - var str = '' + string; - var match = matchHtmlRegExp.exec(str); - - if (!match) { - return str; - } - - var escape; - var html = ''; - var index = 0; - var lastIndex = 0; - - for (index = match.index; index < str.length; index++) { - switch (str.charCodeAt(index)) { - case 34: // " - escape = '"'; - break; - case 38: // & - escape = '&'; - break; - case 39: // ' - escape = '''; - break; - case 60: // < - escape = '<'; - break; - case 62: // > - escape = '>'; - break; - default: - continue; - } - - if (lastIndex !== index) { - html += str.substring(lastIndex, index); - } - - lastIndex = index + 1; - html += escape; - } - - return lastIndex !== index - ? html + str.substring(lastIndex, index) - : html; -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/package.json" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/package.json" deleted file mode 100644 index 3a29fd548691e176c01aecec62b9d22776433c98..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/escape-html/package.json" +++ /dev/null @@ -1,59 +0,0 @@ -{ - "_from": "escape-html@~1.0.3", - "_id": "escape-html@1.0.3", - "_inBundle": false, - "_integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=", - "_location": "/escape-html", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "escape-html@~1.0.3", - "name": "escape-html", - "escapedName": "escape-html", - "rawSpec": "~1.0.3", - "saveSpec": null, - "fetchSpec": "~1.0.3" - }, - "_requiredBy": [ - "/express", - "/finalhandler", - "/send", - "/serve-static" - ], - "_resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "_shasum": "0258eae4d3d0c0974de1c169188ef0051d1d1988", - "_spec": "escape-html@~1.0.3", - "_where": "C:\\Users\\Administrator\\Desktop\\student\\node_modules\\express", - "bugs": { - "url": "https://github.com/component/escape-html/issues" - }, - "bundleDependencies": false, - "deprecated": false, - "description": "Escape string for use in HTML", - "devDependencies": { - "beautify-benchmark": "0.2.4", - "benchmark": "1.0.0" - }, - "files": [ - "LICENSE", - "Readme.md", - "index.js" - ], - "homepage": "https://github.com/component/escape-html#readme", - "keywords": [ - "escape", - "html", - "utility" - ], - "license": "MIT", - "name": "escape-html", - "repository": { - "type": "git", - "url": "git+https://github.com/component/escape-html.git" - }, - "scripts": { - "bench": "node benchmark/index.js" - }, - "version": "1.0.3" -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/HISTORY.md" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/HISTORY.md" deleted file mode 100644 index 222b293dee9f8712b82a7e453c1f80e6e65348e7..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/HISTORY.md" +++ /dev/null @@ -1,83 +0,0 @@ -1.8.1 / 2017-09-12 -================== - - * perf: replace regular expression with substring - -1.8.0 / 2017-02-18 -================== - - * Use SHA1 instead of MD5 for ETag hashing - - Improves performance for larger entities - - Works with FIPS 140-2 OpenSSL configuration - -1.7.0 / 2015-06-08 -================== - - * Always include entity length in ETags for hash length extensions - * Generate non-Stats ETags using MD5 only (no longer CRC32) - * Improve stat performance by removing hashing - * Remove base64 padding in ETags to shorten - * Use MD5 instead of MD4 in weak ETags over 1KB - -1.6.0 / 2015-05-10 -================== - - * Improve support for JXcore - * Remove requirement of `atime` in the stats object - * Support "fake" stats objects in environments without `fs` - -1.5.1 / 2014-11-19 -================== - - * deps: crc@3.2.1 - - Minor fixes - -1.5.0 / 2014-10-14 -================== - - * Improve string performance - * Slightly improve speed for weak ETags over 1KB - -1.4.0 / 2014-09-21 -================== - - * Support "fake" stats objects - * Support Node.js 0.6 - -1.3.1 / 2014-09-14 -================== - - * Use the (new and improved) `crc` for crc32 - -1.3.0 / 2014-08-29 -================== - - * Default strings to strong ETags - * Improve speed for weak ETags over 1KB - -1.2.1 / 2014-08-29 -================== - - * Use the (much faster) `buffer-crc32` for crc32 - -1.2.0 / 2014-08-24 -================== - - * Add support for file stat objects - -1.1.0 / 2014-08-24 -================== - - * Add fast-path for empty entity - * Add weak ETag generation - * Shrink size of generated ETags - -1.0.1 / 2014-08-24 -================== - - * Fix behavior of string containing Unicode - -1.0.0 / 2014-05-18 -================== - - * Initial release diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/LICENSE" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/LICENSE" deleted file mode 100644 index cab251c2b9a81318267600f68130faa3a290e5fd..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/LICENSE" +++ /dev/null @@ -1,22 +0,0 @@ -(The MIT License) - -Copyright (c) 2014-2016 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/README.md" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/README.md" deleted file mode 100644 index 09c2169e7b3ab576199dfe890b2f04cb645c5ac7..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/README.md" +++ /dev/null @@ -1,159 +0,0 @@ -# etag - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Create simple HTTP ETags - -This module generates HTTP ETags (as defined in RFC 7232) for use in -HTTP responses. - -## Installation - -This is a [Node.js](https://nodejs.org/en/) module available through the -[npm registry](https://www.npmjs.com/). Installation is done using the -[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): - -```sh -$ npm install etag -``` - -## API - - - -```js -var etag = require('etag') -``` - -### etag(entity, [options]) - -Generate a strong ETag for the given entity. This should be the complete -body of the entity. Strings, `Buffer`s, and `fs.Stats` are accepted. By -default, a strong ETag is generated except for `fs.Stats`, which will -generate a weak ETag (this can be overwritten by `options.weak`). - - - -```js -res.setHeader('ETag', etag(body)) -``` - -#### Options - -`etag` accepts these properties in the options object. - -##### weak - -Specifies if the generated ETag will include the weak validator mark (that -is, the leading `W/`). The actual entity tag is the same. The default value -is `false`, unless the `entity` is `fs.Stats`, in which case it is `true`. - -## Testing - -```sh -$ npm test -``` - -## Benchmark - -```bash -$ npm run-script bench - -> etag@1.8.1 bench nodejs-etag -> node benchmark/index.js - - http_parser@2.7.0 - node@6.11.1 - v8@5.1.281.103 - uv@1.11.0 - zlib@1.2.11 - ares@1.10.1-DEV - icu@58.2 - modules@48 - openssl@1.0.2k - -> node benchmark/body0-100b.js - - 100B body - - 4 tests completed. - - buffer - strong x 258,647 ops/sec ±1.07% (180 runs sampled) - buffer - weak x 263,812 ops/sec ±0.61% (184 runs sampled) - string - strong x 259,955 ops/sec ±1.19% (185 runs sampled) - string - weak x 264,356 ops/sec ±1.09% (184 runs sampled) - -> node benchmark/body1-1kb.js - - 1KB body - - 4 tests completed. - - buffer - strong x 189,018 ops/sec ±1.12% (182 runs sampled) - buffer - weak x 190,586 ops/sec ±0.81% (186 runs sampled) - string - strong x 144,272 ops/sec ±0.96% (188 runs sampled) - string - weak x 145,380 ops/sec ±1.43% (187 runs sampled) - -> node benchmark/body2-5kb.js - - 5KB body - - 4 tests completed. - - buffer - strong x 92,435 ops/sec ±0.42% (188 runs sampled) - buffer - weak x 92,373 ops/sec ±0.58% (189 runs sampled) - string - strong x 48,850 ops/sec ±0.56% (186 runs sampled) - string - weak x 49,380 ops/sec ±0.56% (190 runs sampled) - -> node benchmark/body3-10kb.js - - 10KB body - - 4 tests completed. - - buffer - strong x 55,989 ops/sec ±0.93% (188 runs sampled) - buffer - weak x 56,148 ops/sec ±0.55% (190 runs sampled) - string - strong x 27,345 ops/sec ±0.43% (188 runs sampled) - string - weak x 27,496 ops/sec ±0.45% (190 runs sampled) - -> node benchmark/body4-100kb.js - - 100KB body - - 4 tests completed. - - buffer - strong x 7,083 ops/sec ±0.22% (190 runs sampled) - buffer - weak x 7,115 ops/sec ±0.26% (191 runs sampled) - string - strong x 3,068 ops/sec ±0.34% (190 runs sampled) - string - weak x 3,096 ops/sec ±0.35% (190 runs sampled) - -> node benchmark/stats.js - - stat - - 4 tests completed. - - real - strong x 871,642 ops/sec ±0.34% (189 runs sampled) - real - weak x 867,613 ops/sec ±0.39% (190 runs sampled) - fake - strong x 401,051 ops/sec ±0.40% (189 runs sampled) - fake - weak x 400,100 ops/sec ±0.47% (188 runs sampled) -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/etag.svg -[npm-url]: https://npmjs.org/package/etag -[node-version-image]: https://img.shields.io/node/v/etag.svg -[node-version-url]: https://nodejs.org/en/download/ -[travis-image]: https://img.shields.io/travis/jshttp/etag/master.svg -[travis-url]: https://travis-ci.org/jshttp/etag -[coveralls-image]: https://img.shields.io/coveralls/jshttp/etag/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/etag?branch=master -[downloads-image]: https://img.shields.io/npm/dm/etag.svg -[downloads-url]: https://npmjs.org/package/etag diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/index.js" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/index.js" deleted file mode 100644 index 2a585c91f07351e9566d50faec67a0272367ba81..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/index.js" +++ /dev/null @@ -1,131 +0,0 @@ -/*! - * etag - * Copyright(c) 2014-2016 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module exports. - * @public - */ - -module.exports = etag - -/** - * Module dependencies. - * @private - */ - -var crypto = require('crypto') -var Stats = require('fs').Stats - -/** - * Module variables. - * @private - */ - -var toString = Object.prototype.toString - -/** - * Generate an entity tag. - * - * @param {Buffer|string} entity - * @return {string} - * @private - */ - -function entitytag (entity) { - if (entity.length === 0) { - // fast-path empty - return '"0-2jmj7l5rSw0yVb/vlWAYkK/YBwk"' - } - - // compute hash of entity - var hash = crypto - .createHash('sha1') - .update(entity, 'utf8') - .digest('base64') - .substring(0, 27) - - // compute length of entity - var len = typeof entity === 'string' - ? Buffer.byteLength(entity, 'utf8') - : entity.length - - return '"' + len.toString(16) + '-' + hash + '"' -} - -/** - * Create a simple ETag. - * - * @param {string|Buffer|Stats} entity - * @param {object} [options] - * @param {boolean} [options.weak] - * @return {String} - * @public - */ - -function etag (entity, options) { - if (entity == null) { - throw new TypeError('argument entity is required') - } - - // support fs.Stats object - var isStats = isstats(entity) - var weak = options && typeof options.weak === 'boolean' - ? options.weak - : isStats - - // validate argument - if (!isStats && typeof entity !== 'string' && !Buffer.isBuffer(entity)) { - throw new TypeError('argument entity must be string, Buffer, or fs.Stats') - } - - // generate entity tag - var tag = isStats - ? stattag(entity) - : entitytag(entity) - - return weak - ? 'W/' + tag - : tag -} - -/** - * Determine if object is a Stats object. - * - * @param {object} obj - * @return {boolean} - * @api private - */ - -function isstats (obj) { - // genuine fs.Stats - if (typeof Stats === 'function' && obj instanceof Stats) { - return true - } - - // quack quack - return obj && typeof obj === 'object' && - 'ctime' in obj && toString.call(obj.ctime) === '[object Date]' && - 'mtime' in obj && toString.call(obj.mtime) === '[object Date]' && - 'ino' in obj && typeof obj.ino === 'number' && - 'size' in obj && typeof obj.size === 'number' -} - -/** - * Generate a tag for a stat. - * - * @param {object} stat - * @return {string} - * @private - */ - -function stattag (stat) { - var mtime = stat.mtime.getTime().toString(16) - var size = stat.size.toString(16) - - return '"' + size + '-' + mtime + '"' -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/package.json" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/package.json" deleted file mode 100644 index 76c9eb43b53d13bb3bf8675939ed6d369cf855ab..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/etag/package.json" +++ /dev/null @@ -1,86 +0,0 @@ -{ - "_from": "etag@~1.8.1", - "_id": "etag@1.8.1", - "_inBundle": false, - "_integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", - "_location": "/etag", - "_phantomChildren": {}, - "_requested": { - "type": "range", - "registry": true, - "raw": "etag@~1.8.1", - "name": "etag", - "escapedName": "etag", - "rawSpec": "~1.8.1", - "saveSpec": null, - "fetchSpec": "~1.8.1" - }, - "_requiredBy": [ - "/express", - "/send" - ], - "_resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "_shasum": "41ae2eeb65efa62268aebfea83ac7d79299b0887", - "_spec": "etag@~1.8.1", - "_where": "C:\\Users\\Administrator\\Desktop\\student\\node_modules\\express", - "bugs": { - "url": "https://github.com/jshttp/etag/issues" - }, - "bundleDependencies": false, - "contributors": [ - { - "name": "Douglas Christopher Wilson", - "email": "doug@somethingdoug.com" - }, - { - "name": "David Björklund", - "email": "david.bjorklund@gmail.com" - } - ], - "deprecated": false, - "description": "Create simple HTTP ETags", - "devDependencies": { - "beautify-benchmark": "0.2.4", - "benchmark": "2.1.4", - "eslint": "3.19.0", - "eslint-config-standard": "10.2.1", - "eslint-plugin-import": "2.7.0", - "eslint-plugin-markdown": "1.0.0-beta.6", - "eslint-plugin-node": "5.1.1", - "eslint-plugin-promise": "3.5.0", - "eslint-plugin-standard": "3.0.1", - "istanbul": "0.4.5", - "mocha": "1.21.5", - "safe-buffer": "5.1.1", - "seedrandom": "2.4.3" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "README.md", - "index.js" - ], - "homepage": "https://github.com/jshttp/etag#readme", - "keywords": [ - "etag", - "http", - "res" - ], - "license": "MIT", - "name": "etag", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/etag.git" - }, - "scripts": { - "bench": "node benchmark/index.js", - "lint": "eslint --plugin markdown --ext js,md .", - "test": "mocha --reporter spec --bail --check-leaks test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "1.8.1" -} diff --git "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/express/History.md" "b/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/express/History.md" deleted file mode 100644 index 41cacce786f415372c6b10e9e5a1167476be2081..0000000000000000000000000000000000000000 --- "a/\351\231\210\345\207\257/Vue\344\275\234\344\270\232/node_modules/express/History.md" +++ /dev/null @@ -1,3510 +0,0 @@ -4.17.2 / 2021-12-16 -=================== - - * Fix handling of `undefined` in `res.jsonp` - * Fix handling of `undefined` when `"json escape"` is enabled - * Fix incorrect middleware execution with unanchored `RegExp`s - * Fix `res.jsonp(obj, status)` deprecation message - * Fix typo in `res.is` JSDoc - * deps: body-parser@1.19.1 - - deps: bytes@3.1.1 - - deps: http-errors@1.8.1 - - deps: qs@6.9.6 - - deps: raw-body@2.4.2 - - deps: safe-buffer@5.2.1 - - deps: type-is@~1.6.18 - * deps: content-disposition@0.5.4 - - deps: safe-buffer@5.2.1 - * deps: cookie@0.4.1 - - Fix `maxAge` option to reject invalid values - * deps: proxy-addr@~2.0.7 - - Use `req.socket` over deprecated `req.connection` - - deps: forwarded@0.2.0 - - deps: ipaddr.js@1.9.1 - * deps: qs@6.9.6 - * deps: safe-buffer@5.2.1 - * deps: send@0.17.2 - - deps: http-errors@1.8.1 - - deps: ms@2.1.3 - - pref: ignore empty http tokens - * deps: serve-static@1.14.2 - - deps: send@0.17.2 - * deps: setprototypeof@1.2.0 - -4.17.1 / 2019-05-25 -=================== - - * Revert "Improve error message for `null`/`undefined` to `res.status`" - -4.17.0 / 2019-05-16 -=================== - - * Add `express.raw` to parse bodies into `Buffer` - * Add `express.text` to parse bodies into string - * Improve error message for non-strings to `res.sendFile` - * Improve error message for `null`/`undefined` to `res.status` - * Support multiple hosts in `X-Forwarded-Host` - * deps: accepts@~1.3.7 - * deps: body-parser@1.19.0 - - Add encoding MIK - - Add petabyte (`pb`) support - - Fix parsing array brackets after index - - deps: bytes@3.1.0 - - deps: http-errors@1.7.2 - - deps: iconv-lite@0.4.24 - - deps: qs@6.7.0 - - deps: raw-body@2.4.0 - - deps: type-is@~1.6.17 - * deps: content-disposition@0.5.3 - * deps: cookie@0.4.0 - - Add `SameSite=None` support - * deps: finalhandler@~1.1.2 - - Set stricter `Content-Security-Policy` header - - deps: parseurl@~1.3.3 - - deps: statuses@~1.5.0 - * deps: parseurl@~1.3.3 - * deps: proxy-addr@~2.0.5 - - deps: ipaddr.js@1.9.0 - * deps: qs@6.7.0 - - Fix parsing array brackets after index - * deps: range-parser@~1.2.1 - * deps: send@0.17.1 - - Set stricter CSP header in redirect & error responses - - deps: http-errors@~1.7.2 - - deps: mime@1.6.0 - - deps: ms@2.1.1 - - deps: range-parser@~1.2.1 - - deps: statuses@~1.5.0 - - perf: remove redundant `path.normalize` call - * deps: serve-static@1.14.1 - - Set stricter CSP header in redirect response - - deps: parseurl@~1.3.3 - - deps: send@0.17.1 - * deps: setprototypeof@1.1.1 - * deps: statuses@~1.5.0 - - Add `103 Early Hints` - * deps: type-is@~1.6.18 - - deps: mime-types@~2.1.24 - - perf: prevent internal `throw` on invalid type - -4.16.4 / 2018-10-10 -=================== - - * Fix issue where `"Request aborted"` may be logged in `res.sendfile` - * Fix JSDoc for `Router` constructor - * deps: body-parser@1.18.3 - - Fix deprecation warnings on Node.js 10+ - - Fix stack trace for strict json parse error - - deps: depd@~1.1.2 - - deps: http-errors@~1.6.3 - - deps: iconv-lite@0.4.23 - - deps: qs@6.5.2 - - deps: raw-body@2.3.3 - - deps: type-is@~1.6.16 - * deps: proxy-addr@~2.0.4 - - deps: ipaddr.js@1.8.0 - * deps: qs@6.5.2 - * deps: safe-buffer@5.1.2 - -4.16.3 / 2018-03-12 -=================== - - * deps: accepts@~1.3.5 - - deps: mime-types@~2.1.18 - * deps: depd@~1.1.2 - - perf: remove argument reassignment - * deps: encodeurl@~1.0.2 - - Fix encoding `%` as last character - * deps: finalhandler@1.1.1 - - Fix 404 output for bad / missing pathnames - - deps: encodeurl@~1.0.2 - - deps: statuses@~1.4.0 - * deps: proxy-addr@~2.0.3 - - deps: ipaddr.js@1.6.0 - * deps: send@0.16.2 - - Fix incorrect end tag in default error & redirects - - deps: depd@~1.1.2 - - deps: encodeurl@~1.0.2 - - deps: statuses@~1.4.0 - * deps: serve-static@1.13.2 - - Fix incorrect end tag in redirects - - deps: encodeurl@~1.0.2 - - deps: send@0.16.2 - * deps: statuses@~1.4.0 - * deps: type-is@~1.6.16 - - deps: mime-types@~2.1.18 - -4.16.2 / 2017-10-09 -=================== - - * Fix `TypeError` in `res.send` when given `Buffer` and `ETag` header set - * perf: skip parsing of entire `X-Forwarded-Proto` header - -4.16.1 / 2017-09-29 -=================== - - * deps: send@0.16.1 - * deps: serve-static@1.13.1 - - Fix regression when `root` is incorrectly set to a file - - deps: send@0.16.1 - -4.16.0 / 2017-09-28 -=================== - - * Add `"json escape"` setting for `res.json` and `res.jsonp` - * Add `express.json` and `express.urlencoded` to parse bodies - * Add `options` argument to `res.download` - * Improve error message when autoloading invalid view engine - * Improve error messages when non-function provided as middleware - * Skip `Buffer` encoding when not generating ETag for small response - * Use `safe-buffer` for improved Buffer API - * deps: accepts@~1.3.4 - - deps: mime-types@~2.1.16 - * deps: content-type@~1.0.4 - - perf: remove argument reassignment - - perf: skip parameter parsing when no parameters - * deps: etag@~1.8.1 - - perf: replace regular expression with substring - * deps: finalhandler@1.1.0 - - Use `res.headersSent` when available - * deps: parseurl@~1.3.2 - - perf: reduce overhead for full URLs - - perf: unroll the "fast-path" `RegExp` - * deps: proxy-addr@~2.0.2 - - Fix trimming leading / trailing OWS in `X-Forwarded-For` - - deps: forwarded@~0.1.2 - - deps: ipaddr.js@1.5.2 - - perf: reduce overhead when no `X-Forwarded-For` header - * deps: qs@6.5.1 - - Fix parsing & compacting very deep objects - * deps: send@0.16.0 - - Add 70 new types for file extensions - - Add `immutable` option - - Fix missing `