Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jashkenas/underscore
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: bf5a0ed27599f99ea59a0839c5bc2fb27a46c1cf
Choose a base ref
...
head repository: jashkenas/underscore
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0062d3c70ecaa3671c82604971d44f1eec9a83f1
Choose a head ref

Commits on Mar 8, 2021

  1. Copy the full SHA
    7e7e6d9 View commit details
  2. Copy the full SHA
    6c0cddd View commit details

Commits on Mar 9, 2021

  1. Copy the full SHA
    4fc14f1 View commit details
  2. Upgrade rollup

    jgonggrijp committed Mar 9, 2021
    Copy the full SHA
    4bbf9eb View commit details
  3. Copy the full SHA
    2a604f0 View commit details
  4. Reorder package.json

    jgonggrijp committed Mar 9, 2021
    Copy the full SHA
    5c0cb90 View commit details
  5. Copy the full SHA
    57a4a0e View commit details
  6. Copy the full SHA
    e524023 View commit details
  7. Copy the full SHA
    6639c23 View commit details
  8. Copy the full SHA
    892c341 View commit details
  9. Copy the full SHA
    58d0e20 View commit details
  10. Copy the full SHA
    c4a6dbe View commit details
  11. Copy the full SHA
    c521426 View commit details
  12. Copy the full SHA
    f9cf7af View commit details

Commits on Mar 10, 2021

  1. Copy the full SHA
    645f8fa View commit details
  2. Merge branch 'master' into node-native-esm

    Because the RawGit links should change to Statically in here, too.
    jgonggrijp committed Mar 10, 2021
    Copy the full SHA
    36a3bc8 View commit details
  3. Downgrade Rollup when running Travis CI with Node.js v8

    Rollup v1 accepts our rollup configuration, it just produces
    incorrectly factored bundles for Node.js. The factoring does not
    matter for the tests.
    jgonggrijp committed Mar 10, 2021
    Copy the full SHA
    9dd137c View commit details
  4. Copy the full SHA
    45afe0e View commit details

Commits on Mar 11, 2021

  1. Generate Node.js build in two stages

    This proved necessary in order to preserve all aliases in the new
    Node.js 12+ ESM entry point.
    jgonggrijp committed Mar 11, 2021
    Copy the full SHA
    04b639c View commit details
  2. Copy the full SHA
    5e3da47 View commit details
  3. Copy the full SHA
    0345136 View commit details
  4. Copy the full SHA
    9f88a5e View commit details

Commits on Mar 14, 2021

  1. Copy the full SHA
    52300cc View commit details
  2. Copy the full SHA
    87b5ecd View commit details
  3. Restore comments from 7e89b79

    jgonggrijp committed Mar 14, 2021
    Copy the full SHA
    0c20985 View commit details
  4. Copy the full SHA
    c9e803e View commit details
  5. Copy the full SHA
    c9040fb View commit details
  6. Add diff and docs to the 1.12.1 change log entry

    (cherry picked from commit c9e803e)
    jgonggrijp committed Mar 14, 2021
    Copy the full SHA
    163f032 View commit details

Commits on Mar 29, 2021

  1. Copy the full SHA
    c627e38 View commit details
  2. Copy the full SHA
    9fded0c View commit details
  3. Add "module" exports condition to the package.json

    I found out that Rollup will nowadays prefer the exports field over
    the top-level module field if both are present.
    jgonggrijp committed Mar 29, 2021
    Copy the full SHA
    d6d0f57 View commit details

Commits on Mar 31, 2021

  1. Copy the full SHA
    62c6ad0 View commit details

Commits on Apr 1, 2021

  1. Add a security policy

    jgonggrijp committed Apr 1, 2021
    Copy the full SHA
    acb04e4 View commit details

Commits on Apr 6, 2021

  1. Copy the full SHA
    b2bc393 View commit details
  2. Add .github/FUNDING.yml

    jgonggrijp committed Apr 6, 2021
    Copy the full SHA
    b713f5a View commit details

Commits on Apr 9, 2021

  1. Copy the full SHA
    68d1de8 View commit details
  2. Copy the full SHA
    ac4afe3 View commit details
  3. Copy the full SHA
    97f4cb4 View commit details
  4. Copy the full SHA
    efe5fbf View commit details
  5. Copy the full SHA
    5511d12 View commit details
  6. Merge pull request #2921 from jgonggrijp/prepare-1.13.0

    Prepare 1.13.0
    jgonggrijp authored Apr 9, 2021
    Copy the full SHA
    37dc52a View commit details
  7. Copy the full SHA
    7054a54 View commit details

Commits on Apr 15, 2021

  1. Copy the full SHA
    8b5928c View commit details
  2. Copy the full SHA
    9cda0b0 View commit details
  3. Bump the version to 1.13.1

    jgonggrijp committed Apr 15, 2021
    Copy the full SHA
    76c8d8a View commit details
  4. Update the bundle sizes

    jgonggrijp committed Apr 15, 2021
    Copy the full SHA
    5aa5b52 View commit details
  5. Copy the full SHA
    5630f88 View commit details
  6. Copy the full SHA
    943977e View commit details

Commits on May 16, 2021

  1. Copy the full SHA
    e180ddb View commit details
  2. Copy the full SHA
    f5c02bc View commit details
Showing with 9,501 additions and 1,454 deletions.
  1. +2 −0 .github/FUNDING.yml
  2. +6 −0 .github/config/codeql.yml
  3. +77 −0 .github/workflows/codeql-analysis.yml
  4. +1 −0 .gitignore
  5. +15 −9 .travis.yml
  6. +3 −1 CONTRIBUTING.md
  7. +1 −2 LICENSE
  8. +7 −1 README.md
  9. +38 −0 SECURITY.md
  10. +1 −1 bower.json
  11. +1 −1 docs/modules/_collectNonEnumProps.html
  12. +1 −1 docs/modules/_setup.html
  13. +2 −2 docs/modules/index.html
  14. +3 −3 docs/modules/sample.html
  15. +48 −15 docs/modules/template.html
  16. +323 −290 docs/underscore-esm.html
  17. +498 −260 index.html
  18. +1 −1 karma.conf-sauce.js
  19. +1 −1 karma.conf.js
  20. +10 −1 modules/.eslintrc
  21. +2 −2 modules/_collectNonEnumProps.js
  22. +3 −3 modules/_setup.js
  23. +2 −2 modules/index.js
  24. +1 −1 modules/isObject.js
  25. +2 −2 modules/max.js
  26. +2 −2 modules/min.js
  27. +3 −0 modules/package.json
  28. +2 −2 modules/sample.js
  29. +9 −1 modules/template.js
  30. +1 −1 modules/unzip.js
  31. +1,845 −39 package-lock.json
  32. +65 −20 package.json
  33. +27 −0 rollup.common.js
  34. +31 −29 rollup.config.js
  35. +34 −0 rollup.config2.js
  36. +22 −0 test/collections.js
  37. +10 −0 test/functions.js
  38. +1 −1 test/index.html
  39. +1 −1 test/treeshake.js
  40. +4 −2 test/utility.js
  41. +20 −5 test/vendor/qunit.css
  42. +1,952 −573 test/vendor/qunit.js
  43. +3 −3 underscore-esm-min.js
  44. +1 −1 underscore-esm-min.js.map
  45. +96 −88 underscore-esm.js
  46. +1 −1 underscore-esm.js.map
  47. +4 −4 underscore-min.js
  48. +1 −1 underscore-min.js.map
  49. +2,158 −0 underscore-node-f.cjs
  50. +1 −0 underscore-node-f.cjs.map
  51. +11 −0 underscore-node.cjs
  52. +1 −0 underscore-node.cjs.map
  53. +7 −0 underscore-node.mjs
  54. +1 −0 underscore-node.mjs.map
  55. +6 −0 underscore-umd-min.js
  56. +1 −0 underscore-umd-min.js.map
  57. +2,042 −0 underscore-umd.js
  58. +1 −0 underscore-umd.js.map
  59. +88 −80 underscore.js
  60. +0 −1 underscore.js.map
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tidelift: "npm/underscore"
patreon: juliangonggrijp
6 changes: 6 additions & 0 deletions .github/config/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
paths:
- 'modules/**'
- 'test/**'
- 'test-treeshake/**'
- 'rollup*.js'
- 'index.html'
77 changes: 77 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ master ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
paths:
- 'modules/**'
- 'test/**'
- 'test-treeshake/**'
- 'rollup*.js'
- 'index.html'
schedule:
- cron: '16 8 * * 3'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
config-file: ./.github/config/codeql.yml

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,3 +8,4 @@ coverage
test-treeshake/*-umd.js
amd
cjs
/underscore-node-*-pre*
24 changes: 15 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
language: node_js
services:
- xvfb
sudo: false
jobs:
include:
- node_js: 8
env: EXTRA=false
env:
- DOWNGRADE=true
- EXTRA=false
- node_js: 10
env: EXTRA=true
env:
- DOWNGRADE=false
- EXTRA=false
- node_js: 14
env: EXTRA=false
env:
- DOWNGRADE=false
- EXTRA=true
before_install:
- npm install -g karma-cli
- "[ $EXTRA = false ] || npm install -g karma-cli"
before_script:
- npm install karma-sauce-launcher
- "[ $EXTRA = false ] || npm install karma-sauce-launcher"
- "[ $DOWNGRADE = false ] || npm install rollup@1"
script:
- npm test
- "[ $EXTRA = false ] || npm run lint"
- "[ $EXTRA = true ] || npm run test-node"
- "[ $EXTRA = false ] || npm run coveralls"
- "[ $EXTRA = false ] || npm run test-browser"
- "[ $EXTRA = false ] || karma start karma.conf-sauce.js"
- "[ $EXTRA = false ] || npm run coveralls"
notifications:
email: false
env:
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@

* This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.

* Please do not open a ticket to report a security issue. Consult the [security policy](SECURITY.md) on what to do instead.

* Before you open a ticket or send a pull request, [search](https://github.com/jashkenas/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.

* If you're proposing a new feature, make sure it isn't already implemented in [Underscore-Contrib](https://github.com/documentcloud/underscore-contrib).
@@ -12,4 +14,4 @@

* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/underscore/blob/master/modules/index.js).

* In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release.
* In your pull request, do not add documentation or re-build the minified `underscore-umd-min.js` file. We'll do those things before cutting a new release.
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
Copyright (c) 2009-2020 Jeremy Ashkenas, DocumentCloud and Investigative
Reporters & Editors
Copyright (c) 2009-2022 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -15,7 +15,8 @@ without extending any core JavaScript objects.
For Docs, License, Tests, and pre-packed downloads, see:
https://underscorejs.org

For support and questions, please use
For support and questions, please consult
our [security policy](SECURITY.md),
[the gitter channel](https://gitter.im/jashkenas/underscore)
or [stackoverflow](https://stackoverflow.com/search?q=underscore.js)

@@ -25,4 +26,9 @@ https://github.com/documentcloud
Many thanks to our contributors:
https://github.com/jashkenas/underscore/contributors

You can support the project by donating on
[Patreon](https://patreon.com/juliangonggrijp).
Enterprise coverage is available as part of the
[Tidelift Subscription](https://tidelift.com/subscription/pkg/npm-underscore?utm_source=npm-underscore&utm_medium=referral&utm_campaign=enterprise).

This project adheres to a [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
38 changes: 38 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Security Policy

## Supported Versions

We currently support the following versions of Underscore with security updates:

- the latest commit on the `master` branch (published as "edge" on the
[project website][website]);
- the 1.x release tagged as [latest][npm-latest] on npm;
- any release tagged as [preview][npm-preview] on npm, if present.

[website]: https://underscorejs.org
[npm-latest]: https://www.npmjs.com/package/underscore/v/latest
[npm-preview]: https://www.npmjs.com/package/underscore/v/preview

## Reporting a Vulnerability

Please report security issues by sending an email to
dev@juliangonggrijp.com and jashkenas@gmail.com.

Do __not__ submit an issue ticket or pull request or otherwise publicly
disclose the issue.

After receiving your email, we will respond as soon as possible and indicate
what we plan to do.

## Disclosure policy

After confirming a vulnerability, we will generally release a security update
as soon as possible, including the minimum amount of information required for
software maintainers and system administrators to assess the urgency of the
update for their particular situation.

We postpone the publication of any further details such as code comments,
tests, commit history and diffs, in order to enable a substantial share of the
users to install the security fix before this time.

Upon publication of full details, we will credit the reporter if the reporter wishes to be publicly identified.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "underscore",
"main": "underscore.js",
"main": "underscore-umd.js",
"keywords": ["util", "functional", "server", "client", "browser"],
"ignore" : ["docs", "test", "*.yml", "CNAME", "index.html", "favicon.ico", "CONTRIBUTING.md", ".*", "package.json", "karma.*"]
}
2 changes: 1 addition & 1 deletion docs/modules/_collectNonEnumProps.html
Original file line number Diff line number Diff line change
@@ -873,7 +873,7 @@ <h1>_collectNonEnumProps.js</h1>
<span class="hljs-keyword">var</span> hash = {};
<span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> l = keys.length, i = <span class="hljs-number">0</span>; i &lt; l; ++i) hash[keys[i]] = <span class="hljs-literal">true</span>;
<span class="hljs-keyword">return</span> {
<span class="hljs-attr">contains</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">key</span>) </span>{ <span class="hljs-keyword">return</span> hash[key]; },
<span class="hljs-attr">contains</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">key</span>) </span>{ <span class="hljs-keyword">return</span> hash[key] === <span class="hljs-literal">true</span>; },
<span class="hljs-attr">push</span>: <span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params">key</span>) </span>{
hash[key] = <span class="hljs-literal">true</span>;
<span class="hljs-keyword">return</span> keys.push(key);
2 changes: 1 addition & 1 deletion docs/modules/_setup.html
Original file line number Diff line number Diff line change
@@ -850,7 +850,7 @@ <h1>_setup.js</h1>

</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">var</span> VERSION = <span class="hljs-string">'1.12.1'</span>;</pre></div></div>
<div class="content"><div class='highlight'><pre><span class="hljs-keyword">export</span> <span class="hljs-keyword">var</span> VERSION = <span class="hljs-string">'1.13.2'</span>;</pre></div></div>

</li>

4 changes: 2 additions & 2 deletions docs/modules/index.html
Original file line number Diff line number Diff line change
@@ -865,9 +865,9 @@ <h1 id="named-exports">Named Exports</h1>
<div class="pilwrap ">
<a class="pilcrow" href="#section-3">&#182;</a>
</div>
<pre><code>Underscore.js <span class="hljs-number">1.12</span><span class="hljs-number">.1</span>
<pre><code>Underscore.js <span class="hljs-number">1.13</span><span class="hljs-number">.2</span>
<span class="hljs-attr">https</span>:<span class="hljs-comment">//underscorejs.org</span>
(c) <span class="hljs-number">2009</span><span class="hljs-number">-2020</span> Jeremy Ashkenas, DocumentCloud and Investigative Reporters &amp; Editors
(c) <span class="hljs-number">2009</span><span class="hljs-number">-2021</span> Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters &amp; Editors
Underscore may be freely distributed under the MIT license.</code></pre>
</div>

6 changes: 3 additions & 3 deletions docs/modules/sample.html
Original file line number Diff line number Diff line change
@@ -850,10 +850,10 @@ <h1>sample.js</h1>
</div>

<div class="content"><div class='highlight'><pre><span class="hljs-keyword">import</span> isArrayLike <span class="hljs-keyword">from</span> <span class="hljs-string">'./_isArrayLike.js'</span>;
<span class="hljs-keyword">import</span> clone <span class="hljs-keyword">from</span> <span class="hljs-string">'./clone.js'</span>;
<span class="hljs-keyword">import</span> values <span class="hljs-keyword">from</span> <span class="hljs-string">'./values.js'</span>;
<span class="hljs-keyword">import</span> getLength <span class="hljs-keyword">from</span> <span class="hljs-string">'./_getLength.js'</span>;
<span class="hljs-keyword">import</span> random <span class="hljs-keyword">from</span> <span class="hljs-string">'./random.js'</span>;</pre></div></div>
<span class="hljs-keyword">import</span> random <span class="hljs-keyword">from</span> <span class="hljs-string">'./random.js'</span>;
<span class="hljs-keyword">import</span> toArray <span class="hljs-keyword">from</span> <span class="hljs-string">'./toArray.js'</span>;</pre></div></div>

</li>

@@ -876,7 +876,7 @@ <h1>sample.js</h1>
<span class="hljs-keyword">if</span> (!isArrayLike(obj)) obj = values(obj);
<span class="hljs-keyword">return</span> obj[random(obj.length - <span class="hljs-number">1</span>)];
}
<span class="hljs-keyword">var</span> sample = isArrayLike(obj) ? clone(obj) : values(obj);
<span class="hljs-keyword">var</span> sample = toArray(obj);
<span class="hljs-keyword">var</span> length = <span class="hljs-keyword">get</span><span class="hljs-title">Length</span>(<span class="hljs-params">sample</span>);
<span class="hljs-title">n</span> = <span class="hljs-title">Math</span>.<span class="hljs-title">max</span>(<span class="hljs-params">Math.min(n, length</span>), 0);
<span class="hljs-title">var</span> <span class="hljs-title">last</span> = <span class="hljs-title">length</span> - 1;
Loading